sub find_holes { my @list = @{ shift() }; @list = sort { $a <=> $b } @list; my $low = $list[0]; my $high = $list[-1]; my %isthere = map { $_ => 0 } ($low..$high); $isthere{$_} = "yes" for @list; my @vacancies = grep { not $isthere{$_} } sort keys %isthere; return \@vacancies; }