in reply to How to process each byte in a binary file?

How about IO::Scalar or IO::String ?

You could then seek() and tell() around the string, or read() in 1 byte increments.

I'm not sure what's under the covers, but both seem elegant from the outside.

  • Comment on Re: How to process each byte in a binary file?

Replies are listed 'Best First'.
Re: Re: How to process each byte in a binary file?
by John M. Dlugosz (Monsignor) on Aug 12, 2002 at 21:27 UTC
    Doing a read of one byte does indeed work better than changing the input record size as suggested by an earlier reply.

    It also runs an order of magnitude slower than the next slower method under discussion!

    How it works under the covers? It uses substr.

    —John