#!/usr/bin/perl use strict; use warnings; # cf pl_test/751890.pl my @myarray=qw/two three threee fouuuuur five septigesimal sodium hexaflouride/; my @vowels=qw/a e i o u/; my @words_having_3_vowels; for my $var(@myarray) { my $seen; for my $vowel(@vowels) { if ($var =~ m/$vowel/) { $seen++; if ($seen == 3) { push @words_having_3_vowels, $var; next; } } } } for my $words(@words_having_3_vowels) { print "$words \n"; } =head execution output: pl_test/751890_a.pl septigesimal sodium hexaflouride =cut