while( my $line = ){ ... } ... __DATA__ sample input data #### open (WORDS, 'data.txt') or die "Can't open employees2.txt: $!\n"; my @cols = qw('data.txt'); #### #!/usr/local/bin/perl use strict; use warnings; while (my $line = ) { chomp $line; for my $cut( split /\s+/, $line ){ next if $cut !~ /a/; next if $cut !~ /e/; next if $cut !~ /i/; next if $cut !~ /o/; next if $cut !~ /u/; print "$cut\n"; } } __DATA__ sample line with words input more words thiswordhaseveryvoul so it should print butthisdoesnt nor do these #### $ perl chinamox.pl thiswordhaseveryvoul #### s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)