Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by salva (Canon)
on Apr 19, 2005 at 13:11 UTC ( [id://449226]=note: print w/replies, xml ) Need Help??


in reply to Better expression for $x = !!$y||0

for maximum readibility and if you are doing this kind of conversion in more than one place, you can also create a new "booleanize" operator:
sub booleanize ($) { shift ? 1 : 0 } $x = booleanize $y;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-25 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found