$hexlen = printf("\\x%02x\\x%02x", unpack("C2", pack("n", length($string)));
(Explanation in reply to OP.)
In reply to Re^2: Convert to Hexadecimal
by sauoq
in thread Convert to Hexadecimal
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |