From: "Peña, Botp" Date: 2005-07-30T11:20:09+09:00 Subject: Re: [newbie] make local var visible Yukihiro Matsumoto [mailto:matz@ruby-lang.org] wrote: #How about using class variables? # # module FooTest # @@foo=["a","b","c"] # # def mfoo # @@foo.each do |f| # p f # end # end # end # #"@@foo" can be accessed from anywhere in the FooTest body. yes, sir Matz. I've already also tried that and I like class vars. But how can I answer my peer's question, "duh, and your telling us to change our sh/perl scripts to that? I thought you said ruby is easy to our eyes and brain, botp?" ? my humble request is: can we not extend "locals" to embrace scope outside so they may act like class vars? something like this i want if possible, # script.rb #--------------------- classvar x # maybe, we may declare x as a class local var (just my term) # as if x now has nature like @@x x=1 def mx1 p x #-> 1 end p x #-> 1 def mx2 x = 2 # same x updated p x #-> 2 end p x #-> 2 It is really @@x but without the @@. I hope i am not asking too much :( Again, thank you for answering newbie questions like this. kind regards -botp # # matz. #