in reply to Fastest Search method for strings in large file

With perl 5.10.0 regexes are very fast to search for many constant alternatives. See Re^4: Efficient regex matching with qr//; Can I do better? (Benchmark) for a benchmark comparing perl 5.8.8 and 5.10.0.

The details depend on how your search strings look like. If they contain newlines, you can't just read your strings line by line. If you read block by block, you have to check for matches at block boundaries. So please provide more information on both the search strings and the file that is being searched.

  • Comment on Re: Fastest Search method for strings in large file