From: Jason Roelofs Date: 2006-12-15T03:28:09+09:00 Subject: Re: Hash/2-d array help! ------=_Part_162350_17837339.1166120885230 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline hash = { England => [Liverpool, London, Plymouth], France => [Rennes, Paris] } Jason On 12/14/06, Just Maz wrote: > > Would anyone happen to know how would I go about creating a hash where I > have more then one value equating to another? > i.e. England => Liverpool, England => London, France =>Rennes, > England=>Plymouth, France=>Paris. > > I've tried all sorts of ways to do this but I always seem to overwrite > the old value of hash[england]=liverpool when I try and add London to > england too. > Is this even possible using a conventional hash? Or would I somehow have > to use a hash of arrays or something? > Also...Just how would I recall the values once I have them? > In my experiments I may well have stumbled across the answer but can't > retrieve them. > > Sorry for this question being rather vague but I don't even know the > name of what I'm trying to do or anything about how to do it..I'd > appreciate any help here, at the very least even just a pointer in the > right direction. > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_162350_17837339.1166120885230--