Syntactic Confectionery Delight | |
PerlMonks |
Re^2: if else in the other wayby johngg (Canon) |
on Oct 02, 2010 at 12:12 UTC ( [id://863062]=note: print w/replies, xml ) | Need Help?? |
but a little bit more readable Debatable :-) For a simple yes/no print like this you are probably right. For lengthier outputs with, perhaps, a conditional part in the middle your way involves a lot of repeated text which can obscure meaning. Personally, in such cases I find this layout
more readable than this
particularly if the condition doesn't require parentheses, but others will probably disagree. I would be more likely to write the latter using an if ( ... ) { ... } else { ... } construct anyway as the meaning is more widely familiar. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|