$text_a = pack "H*", $text_b; # and to convert back: $text_b = unpack "H*", $text_a;