Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by prasadbabu (Prior)
on Apr 19, 2005 at 08:12 UTC ( #449134=note: print w/replies, xml ) Need Help??


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

One way.

$y?$x=0:$y=1;

update:$x=$y?0:1 is correct as ambs mentioned.

Prasad

Replies are listed 'Best First'.
Re^2: Better expression for $x = !!$y||0
by ambs (Pilgrim) on Apr 19, 2005 at 08:18 UTC
    Not properly this (typo?). The other reply is correct ($x=$y?0:1)

    Alberto Simões

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2022-12-01 22:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?