The stupid question is the question not asked | |
PerlMonks |
Re: pack() v unpack() padding: bug or ???by Anonymous Monk |
on Feb 16, 2015 at 13:57 UTC ( [id://1116870]=note: print w/replies, xml ) | Need Help?? |
This pack thing is just a pain. unpack is not the exact opposite, no.
The "a", "A", and "Z" types gobble just one value, but pack it as a string of length count, padding with nulls or spaces as needed. When unpacking, "A" strips trailing whitespace and nulls, "Z" strips everything after the first null, and "a" returns data with no stripping at all.pack
In Section
Seekers of Perl Wisdom
|
|