From: ara.t.howard@... Date: 2006-04-21T00:40:06+09:00 Subject: Re: Write Out Then Read In Hash of Two-element Arrays On Fri, 21 Apr 2006, David Bailey wrote: > Thank you. Your suggestion, of course, worked. Why I oddly thought Ruby > should split the hash elements into separate lines, but not the its array > elements, I'll never know! After being up all night, I guess my brain just > stopped working. > > I've seen the acronym yaml around a few times, but short a guessing that it > means yet another meta language I do not know what it actually does, but I > will take a look at it as you suggest. > > Again, thank you. I'm awake now! (:>) > > David it's a serialization format, not a metalanguage. the thing is it's a __readable__ one: harp:~ > cat a.rb require 'yaml' hash = { "a" => 0, "b" => 1, "c" => 2, } open('hash','w'){|f| f.write hash.to_yaml} open('hash'){|f| print f.read} hash = open('hash'){|f| YAML::load f} p hash harp:~ > ruby a.rb --- a: 0 b: 1 c: 2 {"a"=>0, "b"=>1, "c"=>2} regards. -a -- be kind whenever possible... it is always possible. - h.h. the 14th dali lama