From: ara.t.howard@... Date: 2005-12-07T03:32:54+09:00 Subject: Re: simple scope question On Wed, 7 Dec 2005, Glenn M. Lewis wrote: > Is it possible to place another file within the same scope > as another file that loads it? > For example, I can't get this to work: > ----------------------------------------- > #!/usr/bin/env ruby > # file1.rb > file1 = "something" > ----------------------------------------- > #!/usr/bin/env ruby > # file2.rb > load 'file1.rb' > puts file1 > ----------------------------------------- > > C:/>file2.rb > C:/file2.rb:4: undefined local variable or method `file1' for main:Object > (NameError) > > Of course, I could make them global variables, but it would be nice if I > could load it in with the same scope. > > Any ideas? i assume you are making a config file? why not use yaml? -a -- =============================================================================== | ara [dot] t [dot] howard [at] noaa [dot] gov | all happiness comes from the desire for others to be happy. all misery | comes from the desire for oneself to be happy. | -- bodhicaryavatara ===============================================================================