Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by reasonablekeith (Deacon)
on Apr 19, 2005 at 08:53 UTC ( [id://449149]=note: print w/replies, xml ) Need Help??


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

quote:

I rewrote this to:

if ( $x = !!$y || 0 ) { ... }
...

I'm sorry, but that's just awful. I'd never guess what you were actually trying to do here if I stumbled across this code, regardless of how correct it might be.

In my opinion there's not much wrong with your first example, and although the conditional operator does add some brevity, the if else construct is almost certainly more readable to more people.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-25 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found