From: Thomas Hafner Date: 2009-04-26T05:20:06+09:00 Subject: Re: hygienic startup file Robert Klemme wrote/schrieb <75fun4F18b0q6U1@mid.individual.net>: > You can use an anonymous module for this: > > robert@fussel ~ > $ ruby19 <> Module.new do >> TEST = 123 >> puts "Test is #{TEST}" >> end >> puts "Is there TEST?" >> puts TEST >> EOF > Test is 123 > Is there TEST? > -:6:in `
': uninitialized constant TEST (NameError) Interesting: for ruby1.8 there's still TEST. If I replace Module.new by Class.new, it's OK. Seems that I need an anonymous class for ruby 1.8. Regards Thomas