I recently created a Perl script that searches for words that begin with D and and E with this code:
$infile = 'words.txt';
open(IN, $infile);
$count = 0;
while ($word = <IN>) {
chomp($word);
if ($word =~ /^d\w*e$/i) {
print "$word\n";
$count++;
}
}
print "$count\n";
I recently decided to fork the code and create a script that searches for a word that is six letters and letters in the word are in alphabetic (A to Z) order. Instead of using words.txt, I plan to use the Unix standard dictionary located at usr/share/dict/words. How can I accomplish this by modifying this code?