Don't ask to ask, just ask | |
PerlMonks |
Re^6: alternatives to if and series of elsifby kiat (Vicar) |
on Jul 03, 2005 at 11:11 UTC ( [id://472009]=note: print w/replies, xml ) | Need Help?? |
Thanks, gsiems! I did a lazy test prior to your posting above on my while version and, as shown by your automated test, it didn't produce the expected results. The base_points are incremented as long as the condition is true and are returned regardless of the status of the final test, which is the crucial one. I like your ternary version because it's relatively easy to understand. It also tends to be faster as the points go up.
In Section
Seekers of Perl Wisdom
|
|