Converts ascii strings to hex and reverse
use String::HexConvert ':all'; print ascii_to_hex("hello world"); # writes: 68656c6c6f20776f726c64 print hex_to_ascii("68656c6c6f20776f726c64"); # writes: hello world
It is a wrapper around pack and unpack of perl to convert a string of hex digits to ascii and other way around.
Exporter
my $hex = ascii_to_hex($ascii);
Converts a string to pairs of hex digits
my $ascii = hex_to_ascii($hex);
Converts pairs of hex digits to asci
In know the comments like \*(L"is that realy needed?\*(R". \s-1IMHO\s0 yes, because I forget the exact syntax and possibilities of pack and unpack but hex_to_ascii tells me directly what pack \*(L"H*\*(R" does.
pack, unpack, Data::Translate
Andreas Hernitscheck ahernit(\s-1AT\s0)cpan.org
You can redistribute it and/or modify it under the conditions of \s-1LGPL\s0.