From: Gilbert Lau Date: 2007-06-16T23:52:19+09:00 Subject: Re: Adding new value (in array) to existing key in a hash Harry Kakueki wrote: > myhash = {} > myhash["Starbuck"] = [] > myhash["Starbuck"] << [1,2] > myhash["Starbuck"] << [1,7] > > p myhash > p myhash["Starbuck"][1] > p myhash["Starbuck"][1][1] > > > Harry > > -- > > A Look into Japanese Ruby List in English > http://www.kakueki.com/ Thanks a lot. Didn't know it can be so easy. Correct me if I am wrong... the = [] means that i initiate the value for the hash as array first before I input the values as array [i,j] into the hash. Is that the explanation for the code above? -- Posted via http://www.ruby-forum.com/.