Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: A matter of style: how to perform a simple action based on a simple condition?by TomDLux (Vicar) |
on Sep 26, 2010 at 04:25 UTC ( [id://862046]=note: print w/replies, xml ) | Need Help?? |
Using the and && is too much about the implementation. Use it in shell programs where you're grateful for a concise alternative to if{} blocks. Use the if{} if you are going to do several things within the block, or if you are also going to use the else clause. If what is being done is significant, the suffix if focuses on what is being done, rather than why. If the what is minor, the reason is still notable, while far more compact. What I mean is, if you are processing a config file, you want to skip empty lines, ignoring space characters, and ignoring comment lines.
As Occam said: Entia non sunt multiplicanda praeter necessitatem.
In Section
Seekers of Perl Wisdom
|
|