Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by kschwab (Priest)
on Aug 12, 2002 at 20:58 UTC ( #189628=note: print w/ replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://189628]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (14)
As of 2015-07-31 09:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls