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???
In reply to Re: Any caveats in using unpack to right-trim? Why isn't it advertised more?
by ikegami
in thread Any caveats in using unpack to right-trim? Why isn't it advertised more?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |