From: Szymon Drejewicz Date: 2004-04-21T19:44:05+09:00 Subject: Re: binding - how to get current script? I could write: eval("$name = 'Alice') puts $name but it is not smart solution. Exactly what I want to do is: pgResult.fields.each_with_index do |fieldName,i| eval(%Q[ #{fieldName} = '#{pgResult.result[0][i]}' ]) end alternative code fname, sname, age, height, sex = pgResult.result.flatten but if my table in DB has 30 fields the line above isn't so nice so this is the reason why I decided to use eval() for this dirty work :-) -- Szymon Drejewicz