in reply to Re^2: Not sure what I am doing wrong
in thread Not sure what I am doing wrong

Yep, moving that block saves an awful lot of time - as I said, with the block moved, you open the records.txt once only - c/w once per file.

As far as the uninit value is concerned, try...

use File::Find; my $DIR = "/tmp/logs/"; open(RECORDS, "/tmp/logs/records.txt") or die "Could not open records +file: $!"; local $/ = undef; # Ignoring binmode as its a text file my $RE = join '|', <RECORDS>; close RECORDS; find(\&queries, $DIR);
Oops, sorry, my fault - as shown, the $RE lexical variable wasn't defined until after use (by the queries sub).

A user level that continues to overstate my experience :-))