develooper Front page | perl.perl5.porters | Postings from August 2001

Where should a test for pp_divide behaviour go?

Thread Next
From:
Nicholas Clark
Date:
August 19, 2001 15:03
Subject:
Where should a test for pp_divide behaviour go?
Message ID:
20010819230318.M82818@plum.flirble.org
Currently pp_divide reads both operands from the stack before testing
the right operand to see if it is zero. This results in the following
behaviour:

perl -wle 'print undef()/0'
Use of uninitialized value at -e line 1.
Illegal division by zero at -e line 1.

Do we wish to preserve this?
Or is it fair to read the top argument from the stack, and if it is zero
die with "Illegal division" before even inspecting the second argument?

Assuming we do wish to preserve current behaviour, where in which test
script should a test go? It's not obvious to me that it ought to be part
of warnings.t.

Nicholas Clark

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About