unpack and trailing whitespace in strings
jonathan at hst.org.za
Thu May 25 14:56:24 BST 2006
perlfunc says unpack 'A*' strips trailing spaces and nulls.
It appears (in 5.8.6 and 5.8.7 at least) to strip all trailing whitespace:
my $packed = pack 'a*', "A string\n\t";
local $\ = "#\n";
print unpack 'A*', $packed;
print unpack 'a*', $packed;
Which surprised me.
More information about the london.pm