my $first = 0x2d; my $second = 0x05; my $string = sprintf("%02X%02X", hex($first), hex($second));