in reply to Lost in unpack hell

I tried using n2 on the basis that the field is supposed to be twice as long

'N' is a unsigned 32-bit (4 byte) value using the same byte ordering as 'n'

'Q>' is a unsigned 64-bit (8 byte) value using the same byte ordering as 'n'

From the info you gave us, you want

unpack 'a a n N Q> a*'
which can also be written as
unpack 'a a S> L> Q> a*'

That said,

I know from the output of the other program that the ClOrdID in this message is "4295075805"

The long string you gave for ClOrdID translates to 04C6A29EBAD1E5BB(base16).

You're expecting 4295075805(10) = 000000010001A7DD(16)

No matter how you rearrange the hex digit pairs, those will never match. It's clearly not a byte ordering problem.

Replies are listed 'Best First'.
Re^2: Lost in unpack hell
by stevehicks (Sexton) on Feb 11, 2010 at 10:43 UTC
    </cite>The long string you gave for ClOrdID translates to 04C6A29EBAD1E5BB(base16). You're expecting 4295075805(10) = 000000010001A7DD(16) No matter how you rearrange the hex digit pairs, those will never match. It's clearly not a byte ordering problem. </cite> Then that means that the other program is "lying" to me, which _is_ possible I guess since it appears to have other problems. I tried the unpack string you mentioned :
    >> unpack 'a a n N Q> a*'
    but I get : Invalid type 'Q' in unpack at /opt/devel/mdscripts/PerfAgent/lib/enxtUtpDirect.pm This is (I believe)because I'm not using a 64bit perl and I can't because of some PERL packages I am using. Given this, can I use something other than 'Q' ?? Thanks very much for the assistance, it is much appreciated
        thanks very much !!

      Then that means that the other program is "lying"

      No, that does not necessarilly follow from what I said.

        Well maybe not but since I currently lack the knowledge to reliably decode what's the in message it's difficult to draw another conclusion. I'll keep trying but I now seem to have come up against the issue of trying to decode a quad effectively(though I will try the suggestion from Zentara) Thanks for your help by the way !!