On Mon Sep 05 07:30:12 2016, bitcard.org@bernhardwagner.net wrote: > The error is reported with the wrong line number (10 instead of 8). > This error comes from a longer example, where the error was reported > on the last line within the while-block. > > #!/usr/bin/env perl > use strict; > use warnings; > > my @arr = (1, undef); > > my $i = 0; > while( $arr[$i] > 0 ) { > print $i, $/; > $i++; # line 10 > } > > # Causes error: > # Use of uninitialized value $arr[1] in numeric gt (>) at ./while2.pl > line 10. > # However, I'd expect this error to be indicated with line 8, not 10. > # This is probably not easily fixable. See, e.g., discussion of a similar issue in Porting/todo.pod in the section headed "eliminate incorrect line numbers in warnings". > # error reproduced for perls: > # v5.18.2 on Ubuntu 14.04.4 > # 5.23.9 on OSX 10.11.6 (El Capitan) > # 5.23.7 on OSX 10.11.6 (El Capitan) > # 5.16.3 on OSX 10.11.6 (El Capitan) > # 5.25.4 on OSX 10.11.6 (El Capitan) -- James E Keenan (jkeenan@cpan.org) --- via perlbug: queue: perl5 status: new https://rt.perl.org/Ticket/Display.html?id=129203Thread Previous