in reply to [perlre] $_ = /$re/ vs $_ =~ /$re/
The first just calls the match operator on $_, and the second version does the same and then sets $_ to the empty string or 1. Either way, there really should be a test to see if the match is successful before you go using the $1, $2, etc. variables.