in reply to localization of $_
...and you can also be defensive and protect yourself from other code that isn't as nice:
sub mine { local( $_ ); while( <FILE> ) { s/this/that/g; { local( $_ )= $_; yours( $_ ); } s/that/this/g; } [download]