Hi,

In message "Re: Bug when rerouting String#gsub with a block using $1?"
    on 03/08/18, Florian Gross <flgr / ccan.de> writes:

|That's a nice hack, thank you! And I think Nobu Nakada's change even 
|makes it thread-safe, but are you sure that the incosistent behavior 
|of $1 in blocks passed to gsub is needed? IMHO this is a confusing 
|trap and thus a source of unnecessary debugging sessions for users.

Then don't use ugly dollar variables.  But perhaps gsub should have
passed the match data to the block for convenience.

|That aside: Are there other methods like sub, sub!, gsub and gsub! 
|which have this special behavior?

"gets" modifies $_ in local scope.  $_ and $~ (and $1 etc) are treated
specially.

							matz.