in reply to Re^2: Help tightening up a subroutine please
in thread Help tightening up a subroutine please

Hm, somehow I missed that. Given the extra bit of data you supplied, I might recommend the use of List::MoreUtil's firstidx and lastidx functions. The fact that it's XS ought to help with the speed.

# for clarity... my $result; my $src = $matches{$fasta_id}{$sitekey}; # Use a slice and firstidx/lastidx to copy the range of values @newArray = @$src[ (firstidx {$_ >= $lowerlimit} @$src )..(lastidx {$_ <= $upperlimit} + @$src) ]; $result = \@newArray;
<radiant.matrix>
Ramblings and references
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet