From: "R.Seymour" Date: 2002-04-20T05:49:57+09:00 Subject: Re: String to method name On Fri, 19 Apr 2002 15:31:32 -0400, Lyle Johnson wrote: > badGuyType = "mutantMonkey" > badGuyShow = "powerPuffGirls" > badGuy = "Mojo Jojo" > > SenslessNames = {} > SenslessNames[badGuyType] = { badGuyShow => badGuy } > > puts SenslessNames["mutantMonkey"]["powerPuffGirls"] # prints > "Mojo > Jojo" > > Hope this helps, > > Lyle Thanks a lot... it does help, a little. The problem is, I am trying to feed this stuff into (at the moment) a global variable in a block, like this: FILE.each_line do |line| (badGuyType,badGuyShow,badGuy) = line.scan(/^(\S+)\s(\S+)\s(.*)$/).flatten $senslessNames[badGuyType] = {badGuyShow => badGuy} end where the file looks like lines of this: mutantMonkey powerPuffGirls Mojo Jojo mutantMonkey planetOfTheApes Ape Number 3 evilCat powerPuffGirls kitty evilCat planetOfTheApes Ninja Kat 5000 etc. Now, the problem is, I can print out Ninja Kat 5000 and Ape Number 3 at will after the block is done with, but I can't get either of the powerPuffGirls show villians unless I put them below the planetOfTheApes lines (in there respective spots) (btw my decision to put this all in abstract tv show stuff is getting beyond annoying at this point, I apologize). So, now that I've written all of this, it is starkly obvious what is going on (trying to dump off all the thinking processes on this newsgroup is not good for my mind.) senselessNames[mutantMonkey] can only hold one object, as can senselesNames[evilCat]. I need to do the look ups with the first two keys... so, I must say I'm still stuck. Still learning, but still stuck. Thanks, Rich