From: Robert Klemme Date: 2005-05-27T17:55:19+09:00 Subject: Re: hash of hash and complex data structure Just for the record, as I don't see any post that actually shows code with the block in this thread. ngoc wrote: > Hi > I am perl programmer, looking for new tools and interested in Ruby > How in ruby similar to perl > $a{$b}{$c}{$d} = 1; >> missing = lambda {|h,k| h[k] = Hash.new(&missing)} => # >> h = Hash.new(&missing) => {} >> h[1][2][3] = 4 => 4 >> h => {2=>{3=>4}} > push @{$a{$b}} = 1; >> h = Hash.new {|h,k| h[k] = []} => {} >> h[1].push 2 => [2] >> h => {1=>[2]} Kind regards robert