Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Missing byte using unpack, pack, read(in terms of bytes)

by RichardK (Priest)
on Jul 23, 2012 at 22:46 UTC ( #983247=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Missing byte using unpack, pack, read(in terms of bytes)
in thread Missing byte using unpack, pack, read(in terms of bytes)

You need to call binmode after you open the file

open(IN,'<','filename') or die "$!"; binmode IN;


Comment on Re^3: Missing byte using unpack, pack, read(in terms of bytes)
Download Code
Re^4: Missing byte using unpack, pack, read(in terms of bytes)
by joemaniaci (Sexton) on Jul 23, 2012 at 22:50 UTC

    I owe you a six pack, in all that time researching pack and unpack and endian, I never came across binmode. You're a life saver.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-07-31 05:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (244 votes), past polls