http://qs1969.pair.com?node_id=123615

deprecated has asked for the wisdom of the Perl Monks concerning the following question:

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; }
I'm using the above sub to find holes in a sequence. It worked before I turned it into a sub, and now it seems to not behave as I planned. But I cant seem for the life of me to figure out what is wrong with it.

Can anyone see any glaring problems?

thanks,
brother dep

--
Laziness, Impatience, Hubris, and Generosity.