Ok, so it appears to be the data that's goofy. I re-ran your code snippet and it worked just fine. When I run that on my data I get the error "/ must follow a numeric type" which according to diagnostics is "(F) You had an unpack template that contained a '#', but this did not follow some numeric unpack specification. See perlfunc/pack.". That's an unhelpful error (to me anyway). I had misinterpreted that to be a compile-time error so didn't even think that the unpack format was valid.
Now I'm stuck with a blob of data that doesn't appear to unpack correctly. I tried cutting bits off from the end and oddly - it works sometimes though not consistently from different contexts. The behaviour is so bizarre that I'm just going to have to write a better test for it to tease out where either I'm going wrong or perl is buggy. When I know something further I'll post to this or a new thread later.
__SIG__ printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B:: +svref_2object(sub{})->OUTSIDE
In reply to Re: Re^4: Unpacking fixed length records
by diotalevi
in thread Unpacking fixed length records
by diotalevi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |