isync has asked for the wisdom of the Perl Monks concerning the following question:
Am I missing something. C (Byte), and n (Short) work as expected, but bigger (Long) integers give me 5 (00 00 00 05 instead of FF FF FF FF?
A reverse unpack("N","\xFFFFFFFF") works as well...
#!perl
use Data::HexDump;
my $bin = pack("N",42949672965);
print HexDump($bin);
Because template 'N' is for a unsigned 32-bit value, but 42949672965 requires 36-bits: 0xA_0000_0005; so the high 4-bits are discarded leaving: 0x0000_0005.
If your Perl is capable, use 'Q' instead for integers > 32-bit.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.