in reply to Re: localization of $_
in thread localization of $_
...and you can also be defensive and protect yourself from other code that isn't as nice:
though if you find yourself doing that I strongly suggest you just switch to using my $var instead of $_. - tye (but my friends call me "Tye")sub mine { local( $_ ); while( <FILE> ) { s/this/that/g; { local( $_ )= $_; yours( $_ ); } s/that/this/g; }
|
|---|