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

crenz has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I'm looking for an efficient way to search for all occurrences of a string in a binary file. The problem is: Since the file is binary, I need to read it in blocks rather than lines. This way, however, it is easy to miss occurrences of the string on a block boundary (unless you use a sliding-window approach).

Is there a module that implements a search that takes this into account?