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

Re: A matter of style: how to perform a simple action based on a simple condition?

by JavaFan (Canon)
on Sep 26, 2010 at 10:45 UTC ( #862068=note: print w/ replies, xml ) Need Help??


in reply to A matter of style: how to perform a simple action based on a simple condition?

I'd say, understand what all three do (because no matter what, you'll encounter all three styles if you're going to read other peoples code), and do whatever you find more natural at the time of writing.

I've used all three, probably option two the most. Option three is somewhat slower, as it creates a scope (and creating and tearing down a scope takes some time). But this should only matter in a tight loop.


Comment on Re: A matter of style: how to perform a simple action based on a simple condition?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2014-12-25 21:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (163 votes), past polls