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

Re: Where should a test for pp_divide behaviour go?

Thread Previous | Thread Next
Hugo van der Sanden
August 20, 2001 02:59
Re: Where should a test for pp_divide behaviour go?
Message ID:
Nicholas Clark <> wrote:
: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?

Don't we need to look at the LHS to determine whether division is

: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.

Looks like a test of the presence/absence of a warning to me.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About