in reply to reading binary data from a file
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: reading binary data from a file
by amigero (Novice) on Oct 29, 2009 at 00:12 UTC | |
by ikegami (Patriarch) on Oct 29, 2009 at 00:38 UTC |