Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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
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 taking refuge in the Monastery: (5)
As of 2020-05-28 12:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (165 votes). Check out past polls.

    Notices?