develooper Front page | perl.perl5.porters | Postings from April 2008

Re: [perl #53550] Overload and fallback binary or (|)

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
April 30, 2008 09:01
Subject:
Re: [perl #53550] Overload and fallback binary or (|)
Message ID:
b77c1dce0804300901t4eae3e17v491b333d6042b89e@mail.gmail.com
2008/4/30 via RT Bram <perlbug-followup@perl.org>:
>
>  Shouldn't the fallback of the binary or use the overloaded 0+ instead
>  of the overloaded ""?

Well, binary logical operators work on strings and on numbers. Which
is a source of problems in perl. (and also why one should really not
rely on fallback for those) I suggest a little note in overload.pm to
document the state with overload and logical ops as a potential
gotcha, but I don't think we can do better.

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