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

Re^3: logical non-short-circuit operators

by moritz (Cardinal)
on Nov 03, 2011 at 09:19 UTC ( #935613=note: print w/ replies, xml ) Need Help??


in reply to Re^2: logical non-short-circuit operators
in thread logical non-short-circuit operators

If you have many similar statements, maybe you could refactor them to use a table for the conditions and a loop (or so), or in some other way. Code duplication or near-duplication is usually a sign that you can do it better somehow.

If you want to avoid the variables leaking out, you can just put another block around the whole thing (variable declarations and if block).


Comment on Re^3: logical non-short-circuit operators
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-09-19 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls