On Sep 11, 2007, at 1:20 PM, Mauricio Fernandez wrote:

> On Tue, Sep 11, 2007 at 09:05:49PM +0900, James Edward Gray II wrote:
>> On Sep 10, 2007, at 11:19 PM, murphy wrote:
>>> James Edward Gray II schrieb:
>>>>> gsub sets $_ in the caller's scope.
>>>>
>>>> Which is probably another feature of questionable value.  I know  
>>>> it's
>>>> handy in one-liners, but outside of that code using $_ has been   
>>>> out of
>>>> fashion for some time now.
>>
>>> Is it? I've scanned my local gems, and 29 of 34 use $0-9  
>>> somewhere.  For
>>> example, Rails and HighLine. Actually, I like it better than   
>>> MatchData.
>>
>> I wasn't speaking of the $0-9 regular expression variables.  Please
>> reread the above.
>
> As nobu said already, gsub actually sets $~, which underlies $0 and  
> friends.

And just to be clear, I was speaking only of $_ as being a default  
target for these methods.

James Edward Gray II