in reply to reading packed unsigned long long
It was brought to my attention that despite your use of singular, the hex string should contain 4 numbers. That makes more sense, but your input is still messed up.
"unsigned long long" is not very descriptive. Even saying "C's unsigned long long" is not very descriptive. That simply means they are at least 64-bit and says nothing of byte order.
It seems you want to unpack unsigned 64-bit integers in native or network byte order.
my @vals = unpack('Q*', pack('H*', "000....")); # Native byte order my @vals = unpack('Q>*', pack('H*', "000....")); # Network byte order
">" requires Perl 5.10
"Q" requires a build of Perl that can actually hold 64-bit integers.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: reading packed unsigned long long
by Spooky (Beadle) on Jul 15, 2009 at 14:24 UTC | |
by ikegami (Patriarch) on Jul 15, 2009 at 14:45 UTC | |
by Spooky (Beadle) on Jul 15, 2009 at 15:32 UTC | |
by ikegami (Patriarch) on Jul 15, 2009 at 15:45 UTC | |
by Spooky (Beadle) on Jul 21, 2009 at 13:59 UTC |