http://qs321.pair.com?node_id=723034


in reply to how to speed lookups?

A couple of other changes you might consider are using a hash to check if a line is one that should be kept, and outputting lines you want to keep immediately, rather than accumulating them all in memory:
my %validbufs = map { $_ => 1 } @validbufs; while ($line = <BUFFER>) { $searchfield=(split /\'/,$line)[1]; print $line if $validbufs{$searchfield} }

Replies are listed 'Best First'.
Re^2: how to speed lookups?
by lukka (Novice) on Nov 12, 2008 at 11:44 UTC
    Thank you very much for the suggestions. I will try them out. This forum is awesome!