From: 7stud -- Date: 2011-03-03T04:14:36+09:00 Subject: Re: define_method(): why is the method unable to see $1? > $1, $2 etc. look like global variables but they are in fact local to > the scope where they are set. Aren't local variables also local to the scope where they are set? In other words, what defines a scope in ruby? More specifically, how do you know the extent of $1's scope? In my last example, the each block seems to define the scope of the 'name' variable. Why doesn't the each block also define the scope of the $1 variable--after all the match occurred inside the each block? Thanks. -- Posted via http://www.ruby-forum.com/.