#!/usr/local/bin/perl # # program to extract those words from switchboard.lexicon that #have at least 3 vowels # $file = "switchboard.lexicon"; open(word_file,$file); @line = ; close(word_file); print "Words from switchboard.lexicon that have at least 3 vowels\n"; foreach $line (@line) { $line =~ /^(\S+)\s/; $word = $1; if ($word =~ /^.*[AEIOUaeiou]+.*[AEIOUaeiou]+.*[AEIOUaeiou]+.*$/) { # the word may contain more than 3 vowels # printf "$word\n"; } }