|
|
| There's more than one way to do things | |
| PerlMonks |
Re: For loop suggestionsby moritz (Cardinal) |
| on Jan 11, 2013 at 06:31 UTC ( #1012805=note: print w/ replies, xml ) | Need Help?? |
|
Hello sure_mp, your question would be much more readable if you used a dot at the end of each sentence, and occasionally a paragraph. As for the question: Instead looping from the minimum and the maximum value, simply loop over all the distinct values that you get from the database. For each number, check if it's 1 plus the previous number, and if yes, join them to a range.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||