in reply to Humanized lists of numbers
After some thought, I'd like to modify the if to this:
if (($array[$x] + 1 == $array[$x+1]) && ($array[$x] + 2 == $array[$x+2])) {
That way you don't end up with display-length sub-lists like "1-2, 4-5" in lists. Again, I'm sure there's a better way, but...
|
---|
In Section
Seekers of Perl Wisdom