Subject: | Warning given for wrong line |
An uninitialized value warning inside a try {} block can be reported
with a line number that is incorrect, being several lines before the
place where the warning happens. For example:
use warnings;
use TryCatch;
if (0) {
}
try {
my $y = (undef == 0);
}
This gives
Use of uninitialized value in numeric eq (==) at test line 4.
with perl 5.14. In this case the line number is only off by a couple
(the == is on line 7) but in larger programs it can be wrong by a larger
amount.