From: Eric Armstrong Date: 2006-07-21T11:05:31+09:00 Subject: Re: recursion in scripts -- global variables required? Sean O'Halpin wrote: > On 7/20/06, Eric Armstrong wrote: > >> The question is really about the nature of >> instance variables in a script, I guess. >> It seems they can only be initialized in a >> method. > > Not so. Try this: > > @foo = 1 > def bar > p @foo > end > > bar > #=> 1 > I must be going out of my mind. I can't tell you how many times that has seemed to fail... At the moment, of course, it's working fine. So either something is failing in some strange intermittent way (unlikely) or something is confusing the heck out of me (very likely).