develooper Front page | perl.beginners | Postings from December 2001

summarizing a list of numbers?

Thread Next
From:
Kredler Stefan
Date:
December 17, 2001 04:19
Subject:
summarizing a list of numbers?
Message ID:
511F0D67B671D311935F0008C7F99DFB05CE5961@exchange1.micronas.com
Hello All,

I want to transform a sorted list into a compact list (if this is the
correct term). 
e.g. my list is 

9,11,12,13,14,23,25,26,27,50 	and want to have something like
9,11-14,23,25-27,50 		(to pass on to a unix-command).

Is there any module or function I can use to summarize or compact this?

Thanks for any hint.

Stefan

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About