#!/usr/bin/perl use strict; my @arrays = qw( chatterbox test abode); my @vowels = qw( a e i o u ); foreach my $i (@arrays) { my $count = 0; for (my $j = 0; $j <= (length $i) - 1 ; $j++) { my $letter = substr($i, $j, 1 ); $count++ if ( grep /\b$letter\b/, @vowels ); } print "$i has at least 3 or more vowels.\n" if ( $count >= 3 ); }
In reply to Re: Finding vowels
by bichonfrise74
in thread Finding vowels
by paragkalra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |