Depending on your OS, another problem is the lack of binmode. Add binmode(FH) after the open so that Perl doesn't mess with the data. Not all OSes require binmode, but it's safe to use binmode on all OSes.
Oh and I'd use l instead of i. i is not guaranteed to be 4 bytes.
In reply to Re: reading binary files with Perl
by ikegami
in thread reading binary files with Perl
by jpk1292000
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |