From: Shashank Date Date: 2003-06-25T09:13:59+09:00 Subject: Re: Another Run Time Evaluation Q: "Orion Hunter" wrote in message > However, why does this not work? I can answer this part. Please see "ri eval" output for more details: As of Ruby 1.8, local variables assigned within an eval are only available after the eval if they were defined at the outter scope before the eval executed. In this way eval has the same scoping rules as blocks. > $>ruby -e 'str = "a = 2"; eval(str); puts a' > -e:1: undefined local variable or method `a' for # > (NameError) > > p.s. If I do the equivalent in IRB, it remembers the variable name. I don't know how irb manages to do it : some "binding" magic I guess. Can experts shed some light please? -- shanko