From: Ian Macdonald Date: 2002-03-15T11:05:35+09:00 Subject: new user confused by multidimensional Ruby hashes Hi all, [ianmacd@caliban ~]$ irb irb(main):001:0> foo = Hash.new( {} ) {} irb(main):002:0> foo["bar"]["baz"] = "foo" "foo" irb(main):003:0> foo {} irb(main):004:0> foo["bar"] {"baz"=>"foo"} Can someone please explain to me why, in line 3, 'foo' is empty instead of containing the single element 'bar'? foo["bar"] contains the element 'baz', so why does 'foo' not contain the element 'bar'? I'm used to Perl, as the foregoing probably indicates ;-) Ian -- Ian Macdonald | The nice thing about Windows is - It does System Administrator | not just crash, it displays a dialog box Google, Inc. | and lets you press 'OK' first. (Arno ian@google.com | Schaefer's .sig) 650.330.0100 x1265 |