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

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

by RichardK (Parson)
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;

Replies are listed 'Best First'.
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?
[1nickt]: Yes, and recommendation against using it, in the doc for Devel::Declare, on whcih it is based.
[1nickt]: I asked the new $boiss what I should brush up on before starting work next week, and he named Moo, DBIx::Class and Method::Signatures
[1nickt]: choroba That's why I asked if anyone is using it :-)
choroba only has used Moo from the htree
[1nickt]: Pardonm?
[choroba]: three

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2017-11-24 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (349 votes). Check out past polls.

    Notices?