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

Where should a test for pp_divide behaviour go?

Thread Next
Nicholas Clark
August 19, 2001 15:03
Where should a test for pp_divide behaviour go?
Message ID:
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

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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About