From: Niklas Frykholm Date: 2005-03-15T18:29:46+09:00 Subject: Problem with aliasing String#index Aliasing String#index: "rollo".index(/../, 1) puts "noalias #{$~}" class String alias old_index index def index(*arg) ret = old_index(*arg) puts "inside #{$~}" return ret end end "winni".index(/../, 3) puts "outside #{$~}" gives noalias ol inside ni outside ol To fully duplicate the functionality of the built-in String#index I need to transfer $~ from the local scope to the enclosing scope. Is there any way of doing this? // Niklas