# 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 } }