From: ara.t.howard@... Date: 2007-02-21T05:14:44+09:00 Subject: Re: adding local variables via block On Wed, 21 Feb 2007, Marcello Barnaba wrote: > Hi, > > On Tuesday 20 February 2007 21:02, Patrick Hurley wrote: >> I am not recommending this, but you can force a binding into an eval. >> However, due to how the Ruby parser identifies local variables, they >> need to be referenced in "code" before you can use them normally. > > my irb disagrees: > > vjt@neutrino:~$ irb > /home/vjt| irb(main):001:0> eval 'x = 42', binding > 42 > /home/vjt| irb(main):002:0> x > 42 > /home/vjt| irb(main):003:0> RUBY_VERSION > "1.8.5" > /home/vjt| irb(main):004:0> try writing that in a script. in irb you are __already__ in eval. google the archives for more info. cheers. -a -- we can deny everything, except that we have the possibility of being better. simply reflect on that. - the dalai lama