for (my $i=0; $i<@chroms; $i++) { splice(@chroms, $i--, 1) if not $chroms[$i] =~ /[pqxy]/i; } ####