$Byte1 ="\x22"; $test1 = sprintf('\\x%x', $Byte1); print "$test1";