in reply to Any caveats in using unpack to right-trim? Why isn't it advertised more?
Any caveats in using unpack to right-trim?
There are two:
$ perl -Mv5.14 -e'say length "a\xA0" =~ s/\s+\z//r' 1 $ perl -Mv5.14 -e'say length unpack "A*", "a\xA0"' 2
$ perl -Mv5.14 -e'say length "a\x00" =~ s/\s+\z//r' 2 $ perl -Mv5.14 -e'say length unpack "A*", "a\x00"' 1
I've been unsatisfied with the speed and came with "better" version.
Why doesn't builtin offer this???
|
---|