From: matz@... (Yukihiro Matsumoto) Date: 2003-08-19T03:04:55+09:00 Subject: Re: Bug when rerouting String#gsub with a block using $1? Hi, In message "Re: Bug when rerouting String#gsub with a block using $1?" on 03/08/18, Florian Gross 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.