in reply to Re^4: reading packed unsigned long long
in thread reading packed unsigned long long

what's the standard byte order?

There isn't one.

You're either using your local machine's byte order (which happens to be big-endian) or you're using big-endian explicitly.

The question was whether you want to use the local machine's byte order (whatever it might be) or to use big-endian explicitly.

I also want to look into "Math::BigInt" - I've never heard of this: is it a library of Perl functions?

Math::BigInt

  • Comment on Re^5: reading packed unsigned long long

Replies are listed 'Best First'.
Re^6: reading packed unsigned long long
by Spooky (Beadle) on Jul 21, 2009 at 13:59 UTC
    It may not be the most efficient Perl but I was able to get the results I wanted using the following (not without some trial and error!) - $raw = '000000000000174f0100000000004a000000000000004a'; $x = hex(unpack("H*",(substr($raw,9,6)))) ; $y = hex(unpack("H*",(substr($raw,15,8)))) ; The output was the integer value of 74 in both cases which is what I was shooting for...