my @after; @after = grep { !/[GT]/ } @positions; #### my @after; foreach @positions { push(@after, $_) if (!/[GT]/); }