YAML hash of array (ruby <-> perl)

Z

zm

Hi, I am using yaml to pass data between ruby and perl.

Given the data of h={"a"=>[1,2]}, perl's YAML gives the result of
a:
- 1
- 2

while ruby gives the result of, by YAML.dump(h)
a:
- 1
- 2

Note there is no space after "a:", while perl's have space

Therefore, the data provided by ruby could not be used by perl.
Is this considerd valid YAML?

Thanks!
 
D

Dan Diebolt

--0-1919595936-1134041205=:96101
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Note there is no space after "a:", while perl's have space
=20
I get a space after "a:"
=20
irb(main):020:0> YAML.dump(h)
=3D> "--- \na: \n - 1\n - 2"



=09
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,199
Messages
2,571,045
Members
47,643
Latest member
ashutoshjha_1101

Latest Threads

Top