Hi, the following is not working as I'd like:

def setvars(vars)
  str = ""
  vars.each do |k,v|
    str << "#{k} = #{v}\n"
  end
  puts str
  eval str
end

a = ['an' , 'array']
b = ['another' , 'array']
setvars( { 'a' => a, 'b' => b} )
========
./junk.rb
a = anarray
b = anotherarray
./junk.rb:9:in `setvars': (eval):1:in `setvars': undefined local variable or method `anarray\
' for #<Object:0x8109c88> (NameError)

What I would like is for setvars to have a variables called 'a' and
'b' that point to the arrays that were passed in, not a string version
of the array.

How do I make that happen?

thanks,
-joe