# while not EOF keep going while ( ) { $lineCount++; # increment the lineCount for my $word ( @words ) { my $pat = $regex{ lc($word) }; #next word unless the word is a keyword so store a report in @found next unless ( /$pat/ ); @found = (@found, "\nError in line $lineCount of file $file occurence of \"$word\" :\n\t@words\n"); $foundCount++; # increment total found words } } #### push @found, "\nError in line $lineCount of file $file occurence of \"$word\" :\n\t@words\n"; #### # read in all the keywords from the configFile and put all the words into a hash %regex = map { $_ => qr/$_/ } init_keywords ($ConfigFile); # init_keywords just returns an array of keywords all in lower case. .... #### %regex = map { $_ => qr/$_/i } init_keywords ($ConfigFile);