#!/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