[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

YAML hash of array (ruby <-> perl

zm

12/8/2005 11:16:00 AM

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!

2 Answers

Dan Diebolt

12/8/2005 11:27:00 AM

0

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

I get a space after "a:"

irb(main):020:0> YAML.dump(h)
=> "--- \na: \n - 1\n - 2"




---------------------------------
Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping

zm

12/8/2005 11:41:00 AM

0

My version of ruby is
ruby 1.8.3 (2005-09-21) [i386-mswin32]
Compiled myself

Yours?