http://qs321.pair.com?node_id=1192880


in reply to Re^2: pack and unpack multiple arrays with one common repeat prefix
in thread pack and unpack multiple arrays with one common repeat prefix

Speaking of the solution in two steps, it can be written like this:

$count = unpack "C", $str; @values = unpack "x C$count (V$count)2"

my table driven decoder is just too dumb to do it in two steps...
I have no idea what you mean by "table driven decoder", but maybe we can help you make it work in two steps instead? Or is there some code that you can't modify that can just be fed a pack template and nothing else?

I suppose you can't change the way the data is packed either? Because if you pack only V values, you just have: my (@values) = unpack "C/(V3)", $str;