use Crypt::Tea qw(ascii2str); my $encrypted_ascii = ...; my $str = ascii2str($encrypted_ascii); # now convert to hex: my $hex = unpack "H*", $str;