Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: another variation (variable set to 0 ? 0 : 1)

by sauoq (Abbot)
on Sep 10, 2002 at 00:17 UTC ( [id://196485]=note: print w/replies, xml ) Need Help??


in reply to another variation (variable set to 0 ? 0 : 1)
in thread variable set to 0 ? 0 : 1

$status || 0;

I'll agree that snippet "canonizes false" but it still isn't what the original did. The original canonized numerical equality with 0. The above snippet will return "foo" because "foo" is true. The original would have returned 0 because "foo" == 0 is true.

OK, OK, OK. I'll just be getting on with my life now. :-)

-sauoq
"My two cents aren't worth a dime.";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found