in reply to Re: Convert to Hexadecimal
in thread Convert to Hexadecimal

$hexlen = printf("\\x%02x\\x%02x", unpack("C2", pack("n", length($string)));

(Explanation in reply to OP.)

-sauoq
"My two cents aren't worth a dime.";