P is for Practical | |
PerlMonks |
Re^2: in search of a more elegant if then elseby aaron.m (Novice) |
on Feb 19, 2010 at 00:17 UTC ( [id://824071]=note: print w/replies, xml ) | Need Help?? |
If it "fits," and is easy to read, use the ternary. Otherwise, use the if-then. Think in terms of which one will be easier to understand when someone else - ie. your boss - will be looking over your shoulder while you try to figure out a bug in something you wrote $x months or years ago. Be kind to yourself.
In Section
Seekers of Perl Wisdom
|
|