From: David Bailey Date: 2006-04-21T01:33:54+09:00 Subject: Re: Write Out Then Read In Hash of Two-element Arrays unknown wrote: > On Fri, 21 Apr 2006, David Bailey wrote: > >> >> 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 Yes, thank you for jogging my memory! Now that yo mention it, I do recall reading about yaml in the pickaxe book. It slipped off the edge of my mind, I guess. Geeze, I dislike that forgetfulness thing ... (:>) -- Posted via http://www.ruby-forum.com/.