From: Henrik Horneber Date: 2004-08-14T05:13:34+09:00 Subject: Re: Question: A method for summing several variables Hi! I guess you meant something like this: # $SAFE = 3 box1_1 = "2.3" box1_2 = "2.3" box1_3 = "3.3" box1_4 = "5.3" box1_5 = "6.3" box1_6 = "-2.0" box1_7 = "1.3" box1_8 = "-2.3" box1_9 = "-2.3" boxStr = "box1_" sum = 0 1.upto(9) do |i| boxVarStr = boxStr + i.to_s sum += instance_eval(boxVarStr).to_f end puts sum But unfortunately, this > We set $SAFE to 3 in our application - it needs to be this value. breaks it. Unless there is a way to access local variables given their name as a String that I don't know of (which is not unlikely at all since I'm kinda new to this too ), you're still stuck. But maybe this will give you a hint where to look. Henrik