From: Morton Goldberg Date: 2007-08-03T11:06:51+09:00 Subject: Re: binding - how to explain it? On Aug 2, 2007, at 1:32 PM, dblack@rubypal.com wrote: > Can you produce a complete working example? I'm having trouble > getting it not to not work.... Here's what I'm doing so far: > > a = 1 > > def x > eval(DATA.read, binding) > end > > x # error: a undefined > > __END__ > puts a > > > Is that analogous to what's in the original? I'm kind of late to this party, but is it relevant that each of the following works? a = 1 def x eval(DATA.read, TOPLEVEL_BINDING) end x __END__ puts a def x(a) eval(DATA.read, binding) end x(42) __END__ puts a Regards, Morton