http://qs321.pair.com?node_id=388356


in reply to Finding missing numbers in a list

Set::IntSpan offers some nice features:
use Set::IntSpan; my $set = Set::IntSpan->new("41888, 41889, 41890, 41892, 41895"); $set = $set->complement()->intersect( Set::IntSpan->new($set->min . "-" . $set->max)); print $set->run_list(), "\n";
prints out
41891,41893-41894