in reply to Finding missing elements in a sequence (code)

The problem is with your argument to the find_holes sub. You're returning an array reference, so why not accept an array reference? Try this:

sub find_holes { my $ref = shift; @list = @$ref; @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; }

This worked as far as I could tell. Hope it helps.

~CS

Update: The others are quite right... this does work they way you had it before. *sigh*