my @array = (2,3,4,10,11,12); my $set = new Set::IntSpan join(',', @array); my $list = $set->run_list; # $list is now "2-4,10-12"