my $fn = @ARGV[0]; open(my $fh, '<', $fn) or die("Can't open \"$fn\": $!\n"); binmode($fh); my @recs; while (read($fh, my $rec, 158)) { push @recs, $rec; }
Don't forget binmode on binary files!
In reply to Re: reading binary data from a file
by ikegami
in thread reading binary data from a file
by amigero
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |