From: Johan Eriksson Date: 2008-04-26T00:16:53+09:00 Subject: undefined local variable Hi! I have some troubles with this. obj_as_list.each do |att| if att[1].is_a?(String) att[1] = "'#{att[1]'" end str = "new_obj.#{att[0]} = #{att[1]}" eval(str) end If I type it in irb it works, but when loaded from a function I get this: undefined local variable or method `att' for main:Object It refers to the line inside the if-statement. Any ideas? /Johan