Doctrin has asked for the wisdom of the Perl Monks concerning the following question:
would give me 1,2,3,4,9,16,22,23,24,30,35 . Is there a way to make ranges from a list? Maybe, modules similar to Set::IntSpan, or some algorithm?.. Thanks in advance.use Set::IntSpan; my $span = Set::IntSpan->new('1-4,9,16,22-24,30,35'); print join "," => $span->elements();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get ranges from a list of numbers (like 1,2,3 => 1-3)
by aitap (Curate) on Apr 09, 2013 at 16:46 UTC | |
by Doctrin (Beadle) on Apr 09, 2013 at 19:04 UTC | |
|
Re: Get ranges from a list of numbers (like 1,2,3 => 1-3)
by SuicideJunkie (Vicar) on Apr 09, 2013 at 16:52 UTC | |
|
Re: Get ranges from a list of numbers (like 1,2,3 => 1-3)
by LanX (Saint) on Apr 09, 2013 at 16:45 UTC | |
by Doctrin (Beadle) on Apr 09, 2013 at 19:03 UTC | |
by grizzley (Chaplain) on Apr 11, 2013 at 06:37 UTC | |
|
Re: Get ranges from a list of numbers (like 1,2,3 => 1-3)
by daxim (Curate) on Apr 09, 2013 at 16:47 UTC |