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"
>    
> and what's the equivalence of Perl's $"?
> 
> thx,
> 
> Lei Weng

Try this (I just did in irb):

h = Hash.new
h["a"] = Array.new
h["a"][0] = "something"

Then h["a"] returns:

["something"]

Defining h["a"] as an empty array is what you seemed to be missing.

BTW, h["a"] = [] will of course work just as well.

HTH

-- 
Tim Kynerd  Sundbyberg (sméÔtan i storstan), Sweden  tkynerd / spamcop.net
Sunrise in Stockholm today:  5:31
Sunset in Stockholm today:  18:15
My rail transit photos at http://www.kynerd.nu