in reply to Little help for the (un)pack challenged

Your description of the input format is lacking.

If those numbers represent the numeric values of the bytes of a string, then this is just reconstructing that string from the information supplied:

my $bytes = pack 'C*', 0x00, 0x00, 0x01, 0x16, 0x7A, 0x53, 0x7C, 0x80;

And that can be decoded as a 64-bit network-order unsigned integer using:

print unpack 'Q', scalar reverse $bytes;; 1196053200000

If you have those numeric values in an array of scalars somewhere, you can skip a level:

print unpack 'Q', pack 'C8', reverse 0x00, 0x00, 0x01, 0x16, 0x7A, 0x +53, 0x7C, 0x80;; 1196053200000

Update: And if you have 5.10 with the fancy new endian modifiers, then:

print unpack 'Q>', pack 'C8', 0x00, 0x00, 0x01, 0x16, 0x7A, 0x53, 0x7 +C, 0x80;; 1196053200000

If you don't have a 64-bit integer capable perl, it takes a little more work:

( $hi, $lo ) = unpack 'NN', $bytes;; print +($hi * 2**32 ) + $lo;; 1196053200000

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP PCW It is as I've been saying!(Audio until 20090817)

Replies are listed 'Best First'.
Re^2: Little help for the (un)pack challenged
by Your Mother (Archbishop) on Oct 01, 2009 at 07:54 UTC

    You and almut rule (it's indeed millisecond based though the spec I have says it is plain epoch seconds). The last NN-based version works for me. I don't have 64 bits on this thing. It would have taken me a couple of days to figure that out myself. Thank you!