in reply to Reading Binary
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
|
|---|