my $s = "\x01H"; $s = unpack "H4", $s; print hex $s; # decimal __ENDE__ 328