|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re: Decimal Array rangeby sundialsvc4 (Monsignor) |
| on Dec 21, 2010 at 16:09 UTC ( #878295=note: print w/ replies, xml ) | Need Help?? |
|
When you have a reasonably-sized range of real-numbered values, it is actually cleanest to simply define a list (or an array) of the actual values you want to use. If the values represent known multiples of some base value, you can use an integer range and, within that range, do the necessary calculation. Or, you might use a while loop, initializing the variable outside the loop and adding to its value at the end of the loop. There are many ways to do it. Pick one that is both abundantly-clear and easily maintainable. Remember, “requirements change,” and you will not be (nor will you want to be...) in your present job forever.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||