in reply to Re: count words which contain all vowels in a file.
in thread count words which contain all vowels in a file.
use strict; use warnings; open FH, "file.txt" or die "can't open file : $!"; my $count=0; while(<FH>) { my @array=split; for (@array) { if (/a/ && /e/ && /i/ && /o/ && /u/) # Checking th +e vowels by using if statement { # Printing and counting the words print "$_\n"; $count++; } } } print "No of words: $count";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: count words which contain all vowels in a file.
by Fletch (Bishop) on Apr 01, 2010 at 14:34 UTC | |
|
Re^3: count words which contain all vowels in a file.
by Corion (Patriarch) on Apr 01, 2010 at 08:25 UTC | |
|
Re^3: count words which contain all vowels in a file.
by rovf (Priest) on Apr 01, 2010 at 13:22 UTC |