in reply to Re^2: Decoding binary information
in thread Decoding binary information

You should sign-extend it, Perl isn't used to working with 24 bit integers.

Perl can handle 32 bit integers just fine. You could append '00', pack it into a 4 byte structure (a long), and unpack it as a signed long; and finally divide by 256, for the 2 extra zeros you added.

print unpack('l', pack 'L', hex 'F4EC9E00')/256;
Or, maybe easier, subtract 2**24 if you see it's 2**23 or more.
$n = hex 'F4EC9E'; if($n >= 2**23) { $n -= 2**24 } print $n;