foreach (my $pos2 = 0; $pos2 < $count; $pos2++) { next if $pos2 < $pos1;