Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: how to speed lookups?

by duckyd (Hermit)
on Nov 12, 2008 at 00:45 UTC ( [id://723034] : note . print w/replies, xml ) Need Help??

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!