From: "Peña, Botp" Date: 2005-07-29T20:09:51+09:00 Subject: Re: [newbie] make local var visible #>> I think you have 2 options here (maybe more, but these are #the ones I #>> can come up with as a newbie myself): # #four and counting... # #>> 1) pass foo as an argument. #>> def mfoo(foo) ... end #>> mfoo(foo) #>> 2) make foo an instance-variable #>> @foo = [..] #>> def mfoo #>> @foo.each... #>> end #> #> or make it global (sigh): $foo # #or make a proc from the method Hi Brian/Cristi/Wannes/Kroeger/Kero, and others, Yes. I've done what you have all suggested. Thank you. But I was hoping for something "cleaner". Sorry. Can we request RCR for this? I like the private/public clause for methods. I hope we can provide something like it for vars though; that is, make local vars "public" or "private" like, #test.rb #sample script---------------->8 private_var foo # <--declare something like this or whatever # foo will be visible up to end of test.rb only # as if foo now becomes @foo, or $foo, or what foo=["a","b","c"] def mfoo foo.each do |f| p f end end # go-go-go! mfoo #end sample script------------>8 Will this break ruby design? If yes, please forget i asked. Thanks and kind regards -botp