No such thing as a small change | |
PerlMonks |
Re^4: How Much Is Too Much (on one line of code)?by johngg (Canon) |
on Jun 18, 2007 at 15:36 UTC ( [id://621808]=note: print w/replies, xml ) | Need Help?? |
Perhaps I'd set that particular example up in a hash.
I agree, though, that the ternaries look better than the chained if etc. and I'm not sure at all if my scheme is any clearer than yours in this case.
Looking at both, I think your way is clearer in this case as it is a simple cascade. My way might win out if the logic were more convoluted. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|