in reply to Reading Binary

Open the file (possibly in binmode if you have a silly platform), read in chunks of data (make sure you are reading in chucks that are a multiple of 4 bytes) - either with sysread, or just <> (for the latter, set $/ to a reference to the amount of bytes you want to read), and use unpack to translate the raw bytes to integers.

Here's an example:

#!/usr/bin/perl use strict; use warnings 'all'; open my $fh => "< /tmp/foo" or die $!; $/ = \100; while (<$fh>) { my @nums = unpack "L*" => $_; print "@nums\n"; } close $fh; __END__

Note that I used L in the unpack routine. This is garanteed to be exactly 32 bits, unlike I which is at least 32 bits.

Abigail