Upgrading to 5.18 has caused "Use of uninitialized value in subtraction (-)..." to be printed when executing the following code:
while ($buf =~ /$pat/gp) { push @{ $self->{seen} }, [(pos $buf) - length ${^MATCH}, pos $buf] if not $sub or $sub->(substr ${^PREMATCH}, -200); }
I'm certain that the uninitialized value it refers to is that of ${^MATCH}, but I can't for the life of me figure out why it thinks it's undefined.
The chunk of code falls within the context of a larger subroutine, and I've been unable to recreate the error message except during regular execution of the program of which it is a part.
The only sort of "use VERSION" declaration in the entire program is "require 5.010" in a base package. And the code worked fine before upgrading to 5.18. Any ideas?
In reply to Upgrade to 5.18 causes uninitialized ${^MATCH} by nbtrap
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |