in reply to Using unpack on Windows with external data

Unpack reads from a string, not a filehandle. You need to read from the file first. This works for me:
my $file = $ARGV[0]; open my $fh, '<', $file or die "open: $file: $!\n"; binmode $fh, ':raw'; my $buf; my $n = read($fh, $buf, 2); die "got $n bytes\n" unless $n == 2; my @values = unpack 'S<', $buf; printf "0x%x\n", $_ for @values;

Dave.

Replies are listed 'Best First'.
Re^2: Using unpack on Windows with external data
by locinus (Initiate) on Mar 04, 2017 at 21:27 UTC
    That was actually the solution, thanks a lot!
    (sorry I reply only now...!)