in reply to Re^2: Warning gets the line number wrong?
in thread Warning gets the line number wrong?

Yes, it's annoying, but once you are aware of it (and get used to it), it's not so tough. Here's a simple demo of the basic pattern:
#!/usr/bin/perl -w $_ = undef; if ( 1 == 2 ) { # this is line 4 print "This cannot happen\n"; } elsif ( $_ < 3 ) { # the problem is at line 7 print "This works okay (but throws a warning)\n"; }
You'll see that the warning message cites line 4. Simple rule: when a warning points to an "if" statement and makes no sense for that line, check each of the "elsif" statements that relate to that line.