in reply to Optimising a search of several thousand files
split() and the array cleverness is a little bit slow, so this skips it most of the time:
while (<IN>) { $numlines++; # Remove for more speed next if not /^McDarren\t/; chomp(); my ($user,$level) = (split /\t/)[0,3]; next FILE if $level <= $currlevel; print "$file $user $level"; print "Processed $numlines lines in ". "$numfiles files (total files:$totalfiles)"; exit; }
|
|---|