From: Robert Klemme Date: 2003-03-28T22:19:32+09:00 Subject: Re: Newbie question:Does Ruby have the structure of hash's array like Perl does? "Tim Kynerd" schrieb im Newsbeitrag news:pan.2003.03.28.07.17.11.199188@spamcop.net... > On Fri, 28 Mar 2003 16:01:04 +0900, Weng Lei-QCH1840 wrote: > > > Something like below doesn't work: > > h=Hash.new > > h["a"][0]="something" > > h["a"][1]="another thing" > h = Hash.new > h["a"] = Array.new > h["a"][0] = "something" I think in older versions you can achieve this by (h["a"] ||= [])[0] = "something" I think newer versions can do h = Hash.new{Array.new} h["a"][0] = "something" Regards robert