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";
In reply to Re^2: count words which contain all vowels in a file.
by vennila
in thread count words which contain all vowels in a file.
by vennila
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |