in reply to Re^3: pack() v unpack() padding: bug or ???
in thread pack() v unpack() padding: bug or ???
Isn't 'a2' the behaviour you're asking for?
It depends whether you mean the behaviour I'm looking for in the OP; or the behaviour I expect from Z; but actually, the answer is no in both cases.
It's not a substitute for (my expected behaviour of) Z because it doesn't "null terminate", it only "null pads":
C:\test>p1 print unpack 'C*', pack 'a2', $_ for qw[ fr x ];; 102 114 120 0
And my OP question relates to unpack rather than pack. Athanasius picked up on a comment in a code sample that was more of a reminder to myself rather than a part of the OP.
|
---|