use Set::IntSpan; # CPAN rules :-) use strict; sub expand_number_list { my $run = shift; my $set = Set::IntSpan->new($run); $set->elements; }