From: Park Heesob Date: 2002-06-05T16:20:41+09:00 Subject: Re: eval and local variable "ts" wrote in message news:200206050618.g556IXb01996@moulon.inra.fr... > > When ruby compile the script, it find `foo' at this time there is no local > variable defined (eval is not yet executed) and ruby think that you have > wanted to write `foo()', i.e. a call to the method #foo > > At runtime, eval will create a local variable, but when ruby execute the > lines `p foo' it will try to call the method #foo, because this is what it > has compiled. Here an example > I think the problem is that Ruby cannot distinguish local variable from method by its name. If method called with prefix '&' or postfix '()' , there is no such confusion. Park Heesob.