From: Joseph McDonald Date: 2001-10-23T04:59:45+09:00 Subject: [ruby-talk:22994] Re: assigning variables HEF> One problem, I think, is that eval can't create a HEF> new local variable. (It can, but only within the HEF> context of the eval -- it won't be defined when HEF> you return.) Doh! That definitely sinks my idea. bummer. I did get it to work with instance variables which I think will do. Here is how it works for instance vars: def setvars(vars) @vars = vars str = "" vars.each do |k,v| str << "@#{k} = @vars['#{k}']\n" end puts str eval str puts @a end thanks, -joe