From: "Peña, Botp" Date: 2005-07-29T18:55:31+09:00 Subject: [newbie] make local var visible Hi All, I may not be feeling well today, so pardon me pls. I am modifying/cleaning many scripts here (most of them just a page long, two at most, and most of them coming fr perl/bash origin). I encountered a wall though. Consider, >cat test.rb #sample script---------------->8 foo=["a","b","c"] def mfoo foo.each do |f| p f end end # go-go-go! mfoo #end sample script------------>8 i just enclosed the some commands with def mfoo / end to make a new method mfoo and make my script cleaner, and besides, i may be calling mfoo again. running the above, i get: >test.rb >test.rb:4:in `mfoo': undefined local variable or method `foo' from test.rb:9 So how can i force foo visible to mfoo()? Thanks in advance. -botp