in reply to Searching in binary files

You could do this:

local $/ = "find this string"; while (<FILE>) { if ( chomp ) { # you know you found an occurrence } }

We're building the house of the future together.

Replies are listed 'Best First'.
Re^2: Searching in binary files
by graff (Chancellor) on Dec 15, 2005 at 06:47 UTC
    That is rather a nice idea, except: whether one really could do this depends on file size, and whether the process happens to reach either the target string or end-of-file before it runs out of memory.
Re^2: Searching in binary files
by crenz (Priest) on Dec 15, 2005 at 07:45 UTC

    That looks rather nice -- but unfortunately, it is rather slow also... I'm dealing with files that could potentially be hundreds of megabytes in size.