hex converts *from* hex to a number.
sprintf '%X', $n will represent a number using hex.
In reply to Re^3: pack and unpack trouble by ikegami in thread pack and unpack trouble by scoobyrico