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

Re: Where should a test for pp_divide behaviour go?

Thread Previous | Thread Next
From:
Hugo van der Sanden
Date:
August 20, 2001 02:59
Subject:
Re: Where should a test for pp_divide behaviour go?
Message ID:
200108200958.f7K9wp400584@crypt.compulink.co.uk
Nicholas Clark <nick@ccl4.org> 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
: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?

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

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

Hugo

Thread Previous | 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