When I run the following code to check the error message, perl (5.14.2 on Ubuntu) says
Illegal division by zero at test2.pl line 5.
sub dummy {
if ($a>3) {
$a ++;
}
else { printf(1/0);
}
return 1;
}
dummy();
However, if I remove the space in front of printf
, the error message will say
Illegal division by zero at test2.pl line 2.
Removal of the extra space should not change the line number in the error message here. So it appears that it's a bug on the perl interpreter. Is this right?
Thanks.
Correct, it's a bug. You can let the Perl devs know using command line tool perlbug
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With