in reply to localization of $_
If you use $_ often as a temporary variable, you should definately use local $_; at the beginning of your subroutines to prevent this exact situation from happening.
In Section
Seekers of Perl Wisdom
in reply to localization of $_