From: Joel VanderWerf Date: 2003-10-03T23:37:04+09:00 Subject: Re: hash of hashes Paul Argentoff wrote: ... > I need something like this: > > a = {{}} # this doesn't work, but i've just written it here to emph. the > # subject > ... > # somewhere in the iteration > a[foo][bar] = baz > ... hash_maker = proc do |h, k| h[k] = Hash.new(&hash_maker) end h = Hash.new(&hash_maker) h[1][2][3][4][5] = 6 p h # {1=>{2=>{3=>{4=>{5=>6}}}}}