http://www.perlmonks.org?node_id=964563


in reply to Pattern matching across two files, Need something better than grep -f!

Depending on the size of the files, there may be some gain or loss in time by sorting both files and then iterate through the source patterns and work on successive manageable chunks from the data file. This will bring extra complexity to the script, but the issue is speed.