Keep It Simple, Stupid | |
PerlMonks |
Re: Printing byte as 2 Hex charactersby Eliya (Vicar) |
on May 30, 2012 at 15:12 UTC ( [id://973318]=note: print w/replies, xml ) | Need Help?? |
printf ("%lX ", $buffer); You probably want ord:
because what you have in $buffer is a single byte string, not a number. A more direct way might be to use unpack "H*", ...
or maybe unpack "(H2)*", ..., as in
in which case your buffer could consist of more than one byte.
In Section
Seekers of Perl Wisdom
|
|