in reply to Re^2: Converting ASCII to Hex
in thread Converting ASCII to Hex

If the input string is made of digits, you will see an hex like that you're describing. Consider that in ASCII the digits characters range from decimal 48, which is 0x30, to decimal 57, which is 0x39.

If you have numbers that you want to treat like integers, and they're in the range 0-255, you can put a chr in the chain:

#!/usr/bin/perl use strict; use warnings; my @values = (0, 1, 5, 25, 100, 200, 255); print join(", ", map { unpack "H*", chr } @values), $/; __END__ 00, 01, 05, 19, 64, c8, ff
You may also consider printf/sprintf with the X indicator:
#!/usr/bin/perl use strict; use warnings; my @values = (0, 1, 5, 25, 100, 200, 255, 500, 1000); print join(", ", map { sprintf "%X", $_ } @values), $/; __END__ 0, 1, 5, 19, 64, C8, FF, 1F4, 3E8
Note that this second solution works well with numbers beyond 255. You can also pad with zeroes on the left, just look in the docs for sprintf.

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.