in reply to Rapid text searches
Then I'd iterate over the file, split each line into fields, and test each field against the hash previously build.my %queries; $queries{$_} = 1 for qw(1101077781160 1101077783669 1101077781182);
This avoid multiple passes over the file (as you would with grep), or loading in the entire file into a hash.
And if I only looking for a single entry, perl script will still load everything into memory before it could look for the string I want?You tell us instead of asking! You wrote the code. If you wrote your code it first slurps in the entire file, then the answer is yes. If you wrote your code it didn't, then the answer is no.
|
|---|