From: Jim Weirich Date: 2005-06-02T22:23:43+09:00 Subject: Re: binding, ObjectSpace._id2ref [WAS] Re: [ANN] parseargs-0.0.0 Glenn Parker said: > 2. Assign the eval-initialized variable to a "visible" variable. > > eval "y = 2" > y = eval "y" # make "y" visible afterwards > print "#{y}\n" Actually, you don't even have to actually assign anything to y, you just need to make sure that the Ruby interpreter sees an assignment to y before the print. It's a subtle distinction, but consider the following code: eval "y = 2" y = 0 if false puts y # => 2 (not 0) -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)