The stupid question is the question not asked | |
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 ( [id://862068]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|