length($_) % 2
is to do this:
length($_) & 1
Gives the same result, but it's often a bit faster, because the former forces the processor to perform a division, whereas the second one is a simple bitwise AND. We grab the last bit, and that's all.
In reply to Re^2: Pack uneven length hex
by Anonymous Monk
in thread Pack uneven length hex
by melez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |