Bug#897391: say uninitialized LEFT SIDE value in pattern match
積丹尼 Dan Jacobson
jidanni at jidanni.org
Tue May 1 23:54:37 BST 2018
Package: perl
Version: 5.26.2-3
Severity: wishlist
Sometimes perl tells you which item is uninitialized,
$ perl -we 'print 1 if $x =~ $y;'
Use of uninitialized value $y in regexp compilation at -e line 1.
Use of uninitialized value $x in pattern match (m//) at -e line 1.
$ perl -we 'print 1 if /$y/;'
Use of uninitialized value $y in regexp compilation at -e line 1.
Use of uninitialized value $_ in pattern match (m//) at -e line 1.
But sometimes it doesn't,
next unless $_->getAttribute('class')=~/\b$bold\b/;
Use of uninitialized value in pattern match (m//) at ./parser line 30, <> line 2.
OK whenever it is says "pattern match" it apparently is talking about
the left side of "=~".
But it could be a whole lot clearer.
It could say
Use of uninitialized LEFT SIDE value in pattern match (m//) at ./parser line 30, <> line 2.
More information about the Perl-maintainers
mailing list