From: James Edward Gray II Date: 2005-06-17T01:11:43+09:00 Subject: Re: hash of hashes by default On Jun 16, 2005, at 11:07 AM, Belorion wrote: > I want a Hash of Hashes. Furthermore, I want it so that if a key for > the first has does not exist, the default value is a new hash. irb(main):001:0> foo = Hash.new { |hash, key| hash[key] = Hash.new } => {} irb(main):002:0> foo["ii"]["jj"] = "Hello World." => "Hello World." irb(main):003:0> foo["ii"] => {"jj"=>"Hello World."} irb(main):004:0> foo["ii"]["jj"] => "Hello World." Hope that helps. James Edward Gray II