in reply to Re^7: Getting an unknown error (foreach $1 breaks m//atch)
in thread Getting an unknown error

Re Re^7: Getting an unknown error (foreach $1 breaks m//atch) by an Anonymous Monk: perldoc perlvar again...

$_ is by default a global variable. However, as of perl v5.10.0, you can use a lexical version of $_ by declaring it in a file or in a block with my. Moreover, declaring our $_ restores the global $_ in the current scope. Though this seemed like a good idea at the time it was introduced, lexical $_ actually causes more problems than it solves. If you call a function that expects to be passed information via $_ , it may or may not work, depending on how the function is written, there not being any easy way to solve this. Just avoid lexical $_ , unless you are feeling particularly masochistic.