Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^5: Better expression for $x = !!$y||0

by ysth (Canon)
on Apr 20, 2005 at 07:07 UTC ( [id://449502]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Better expression for $x = !!$y||0
in thread Better expression for $x = !!$y||0

in Perl 6

...

Yes, you can still overload these to return something other than 0 or 1, but it would be construed as antisocial.

That's exactly how I feel WRT doing this in perl5.

Replies are listed 'Best First'.
Re^6: Better expression for $x = !!$y||0
by TimToady (Parson) on Apr 20, 2005 at 20:00 UTC
    Except Perl 5 makes no such guarantee. A lot of the built-ins return "" or 1 instead, for instance.
      Do you mean sv_yes or sv_no (which has PV "" and IV 0)? Or the very few things that actually return either "" or 0 instead of sv_no? IIRC correctly, there are good reasons for those odd cases.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://449502]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-03-29 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found