Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by prasadbabu (Prior)
on Apr 19, 2005 at 08:12 UTC ( [id://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