From: Joel VanderWerf Date: 2008-02-13T06:28:55+09:00 Subject: Re: Ruby equivalent to source command Robert Dober wrote: > On Feb 12, 2008 7:47 PM, Joel VanderWerf wrote: >> Brett Williams wrote: >>> I figured this was the case. I'll go with globals for my context. >> The horror, the horror. > I agree, i agree ;) >> Here's an alternative: http://redshift.sourceforge.net/script. > It does not seem to handle OP's problem though, which are locals or am I wrong? Sorry, I should have made that clear. It uses module_eval, so you don't get locals, but using module constants and/or methods is better than globals :) I like your hack. One possible pitfall is if the file has __END__. Another is that local vars can become methods that globally shadow Kernel/Object methods. For example, add this line to test1.rb: open = false Still, I might add this to the script lib as an option to capture locals in the module. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407