Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A bug on perl interpreter on error message?

Tags:

perl

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.

like image 890
packetie Avatar asked Sep 03 '14 14:09

packetie


1 Answers

Correct, it's a bug. You can let the Perl devs know using command line tool perlbug.

like image 139
ikegami Avatar answered Sep 25 '22 22:09

ikegami