in reply to Re: I want to know exactly what comes through a socket
in thread I want to know exactly what comes through a socket

...sprintf("\\x{%02X}"...

may work better and look better. Note the \\!


DWIM is Perl's answer to Gödel