my $t = "tldmfmyvkif4dwhbvysdrtaysdf"; my @neu = ( grep { $_ ne "y" } split //, $t )[0..12]; print "@neu"; __END__ t l d m f m v k i f 4 d w