# Inputs my $input = "\x30\x05\x15"; my $packed = 1; # Canonize input if ($packed) { $input = unpack('N', substr(("\x00"x4).$input, -4)); } # Do some work #... # Output results printf("Results for 0x%X are %s\n", $input, "...");