You don't say what kind of file it is; so, if you do know anything about the structure of the file, you might to well to take a look at Tie::MmapArray. It works well for files which are strictly arrays of C-struct type data records; in general, such things look like binary to perl.
Then you can simply iterate over the array of structs, and test the various fields for your pattern. You may even know which of the fields might and might not contain what you're searching for.
We're building the house of the future together.