in reply to faster way to grep

If your files are not too large, toolic's solution might be faster if you read in the entire file at one time into an array and loop through the array:
my @fileData = <FILE>; foreach my $fileLine (@fileData) {
Also, if you don't mind using unix grep, you can still use it and do post-processing, by opening the grep as a pipe:
open (DATA, "grep <string> <file-list> |"); while (<DATA>) {