From: 7stud -- Date: 2011-02-26T06:17:02+09:00 Subject: Re: define_method(): why is the method unable to see $1? An online copy of Programming Ruby all the match variables are local to the current scope: http://webcache.googleusercontent.com/search?q=cache:TH-QZKH6TfsJ:phrogz.net/programmingruby/language.html+scope+of+ruby+match+variables&cd=3&hl=en&ct=clnk&gl=us&client=firefox-a&source=www.google.com Here is a simpler example showing that trait of $1: def meth_a "a" =~ /(.)/ puts $1 end meth_a puts "-->#{$1}<---" --output:-- a ---><--- So, Eric Christoperson was right: $1 is a local variable. -- Posted via http://www.ruby-forum.com/.