packetie
packetie

Reputation: 5069

A bug on perl interpreter on error message?

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.

Upvotes: 11

Views: 262

Answers (1)

ikegami
ikegami

Reputation: 386706

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

Upvotes: 3

Related Questions