for my $hit ( @{ $matches{ $fasta_id }{ $sitekey } } ) { next unless $hit >= $lowerlimit; last unless $hit <= $upperlimit; push @arrayA, $hit + 0; } if( @arrayA ) { @{ $sets{ $fasta_id }[ $setscounter ]{ $sitekey } } = @arrayA; } else { %{ $sets{ $fasta_id }[ $setscounter ] } = (); }