From: sy1234 Date: 2007-07-15T13:32:46+09:00 Subject: Re: Contents of variable as variable name Rob Kerfia said the following on 07/14/2007 11:10 PM: > I know that sounds a bit crazy, but is there a way to do that? > > oh oh oh .. I asked this question and did a bit of experimentation a while back. I found a blank spot in my wiki where I was supposed to have written it all down, but I guess I didn't get around to it. I just found and dumped some notes in just now.. maybe something there will help inspire you: http://jrandomhacker.info/Ruby_code_snippets/patching_strings_together_to_make_a_variable if eval isn't appropriate, then this snippet might work: @ab = "pass" puts instance_variable_get("@#{"a" + "b"}")