in reply to search binary file

You probably can use regular expressions - perl strings can hold binary data as well as text.

What is the pattern?