laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
How about
for completness sake. update: I got that backwards. && returns the last part evaluated, and skips the right side if the left already determines the outcome. So, if $status is false it returns it unchanged; if true it evaluates the right hand side and gets a numeric 1. It canonizes true, leaves false as-is. $status || 0; will return $status unchanged if true, and check the rhs if false. So that canonizes false and returns true unchanged.
In reply to another variation (variable set to 0 ? 0 : 1)
by John M. Dlugosz
|
|