Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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?
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 wandering the Monastery: (4)
As of 2014-10-24 07:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (130 votes), past polls