http://www.perlmonks.org?node_id=1019514


in reply to Printing the range

Number::Rangify - Optimize a list of values into ranges