On 2006-11-03, Tom Werner wrote: > Tom Werner wrote: [...] >> One approach might be to gsub out any non word characters (but this >> still makes me a bit queasy): >> >> p eval('test'.gsub(/\W/, '')) >> #=> {:foo=>"bar"} >> > On further consideration, even this is futile. Consider: > > p eval('exit') > > Which leaves you back on the command line. What you want to do is create > a Hash that contains the hash you are interested in: > > test = {:foo => 'bar'} > shelf = {'test' => test} > > Now you can look up the Hash of interest by name: > > p shelf['test'] > #=> #=> {:foo=>"bar"} > > eval is dangerous. VERY DANGEROUS. > > Tom Thanks Tom. I will skip eval for now. I am going to repose my question as I did not do a very good job the first time. Don