Doing this in one statement and with one unpack, if it's even possible (and I don't think it is (Update: but I think wrong: see ig's reply)), might qualify as a neat hack, but it's also a hack which you should then look at, sigh, and set aside in favor of a maintainable two-statement solution. What is the practical advantage of doing this in one statement?

Update: I think I would take a slightly different approach to unpack-ing the final data strings:

sorry for delay acknowledging your and others' posts - I mistook the first response to mine as some kind of disapproval

As to your

What is the practical advantage ...

I view the task of performing the unpacking of the string as logically one task, not two, and so perhaps it is clearer to any reader how this task is being accomplished if done in one reasonably intuitive statement rather than two. If by practical you were thinking more of performance, then none.

And I omitted to say originally that what encouraged me to believe that such a statement might exist is this from perlfunc "pack"

For "unpack", an internal stack of integer arguments unpacked so far is used. You write "/"sequence-item
and the repeat count is obtained by popping off the last element from the stack. The sequence-item must not
have a repeat count.

I was not sure what this meant but it seemed relevant.
I tried using it in various ways but all failed.
I did not find any elucidation of this in perltut.
I *think* some of the suggestions offered in this thread are using such sequence-items but I'm not sure; and if so, I'm also not sure how the argument numbers are being pushed onto the stack.

If anyone can explain what the quoted text means (specifically the integer arguments) or have a simpler example, I would appreciate that.

Note. The reference to "the stack" refers to Perl's argument stack. As unpack processes each element of its template, the values extracted from the input string are pushed onto that stack, so that when the function returns, they are returned to the caller.

When the '/' is encountered, the last value pushed onto the stack is popped off again and used as the repeat count for the next template character. Hence, in the example above, the value '5' generated by the 'C' is not returned to the caller.

The <t1>/<t2> combination (where t1 can be any template char that results in a numeric value) is very useful for streaming communications protocols where you frequently have length-prefixed data items: <len1><data1><len2><data2>.

Unfortunately, there is no sensible way to use it for your struct format where you have <len1><len2><data1><data2>. (That is, I don't consider the absolute positioning solution above a "sensible" approach as it is not really extensible to more than 2 len/data pairs.

It will almost certainly always be quicker and cleaner to do that in two steps:

... the absolute positioning solution ... is not really extensible to more than 2 len/data pairs.

I disagree, with a potential caveat dependent on the exact meaning of the word 'really'. I think I have shown below that an absolute positioning solution can easily (for some definition of 'easy') be generalized to any number of data items using any data length 'type'.

But not all things that are easy are wise, and I continue to agree with you and ig that a two-step approach is almost certainly best.

Ada Lovelace for the palindrome
Albert Einstein for having smelly feet
Alfred Nobel for his contribution to battlefield science
Burkhard Heim for providing the missing link between science and mysticism
Claude Shannnon for riding a unicycle at night at MIT
Donald Knuth for being such a great organist
Edward Teller for being the template for Dr. Strangelove
Edwin Hubble for pretending to be a pipe-smoking English gentleman
Erwin Schrödinger for cruelty to cats
Hedy Lamarr for weaponizing pianos
Hugh Everett for immortality, especially for cats
Isaac Newton for his occult studies
Kikunae Ikeda for discovering the secrets of soy sauce
Larry Wall for his website
Louis Camille Maillard for discovering why steaks taste good
Marie Curie for the shiny stuff
Nikola Tesla for the cool cars
Paul Dirac for speaking one word per hour when socializing
Richard Feynman for his bongo skills
Robert Oppenheimer for his in-depth knowledge of the Bhagavad Gita
Rusi P Taleyarkhan for Cold Fusion
Sigmund Freud for his Ménage ā trois
Theodor W Adorno for his contribution to the reception of jazz
Wilhelm Röntgen for the foundations of body scanners
Yulii Borisovich Khariton for the Tsar Bomba
Other (please explain why)