On Fri, Dec 10, 2004 at 01:28:10PM -0500, Sam Ruby wrote:

> Mike Guy wrote:
> >
> >Perl5 C<xor> always returns a "standard" boolean value, i.e.
> >dualvar(0, '') or dualvar(1, '1').    Perl6/Parrot should do the same
> >thing.
> 
> Try:
> 
>     perl -le "print 'day' xor 'night'"
> 
> On the version of Perl I have installed, I get "day" as the result.

Gordon mentioned the precedence problem here.  I've not replied to his
message because I couldn't be bothered to fix up the quoting and
attributions.  s/le/wle/ gives the hint too.

Mike is quite right of course.  And the code which handles this is one
of the more simple parts of perl5.  Provided you're not too worried
about what's going on under the macros, I suppose.

    if (SvTRUE(left) != SvTRUE(right))
        RETSETYES;
    else
        RETSETNO;


-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

Reply via email to