my $hex = unpack "H", $byte; my $hexstring = unpack "H*", $bytes; my @hex = unpack "H2" x length($bytes), $bytes;