but my suspicion is that the A16 will give me 16 separate array elements
Your intuition is very understandable, but wrong. Loose characters wouldn't be very useful, in general, so the perl implementers chose some other behavior that is more practically useful, as here.
so my template so far looks like this: '??A16CQQQS'
Be very careful: 'Q' doesn't work on all platforms — not even on most platforms. Not all perls can even handle 64 bit integers, 53 bits is the most you can reliably use natively. You may want to look into Math::BigInt (with XS driver).

Also: 'S' is machine dependent. You may want to explicitly choose for 'n' (Big Endian) or 'v' (Little Endian AKA Intel) — which treats it as an unsigned number, BTW. You didn't specify your requirements here, but unsigned numbers can easily be converted to signed, if 2's complement (the usual case), by subtracting 2**16 if the number is 2**15 or higher.

unfortunately without any idea how to do the first 2 16 byte values (which need to remain binary, completely unchanged)
Try 'a16' twice.

In reply to Re: Trouble understanding pack/unpack syntax. by bart
in thread Trouble understanding pack/unpack syntax. by exodist

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.