use warnings; $template = 'D<'; $nv = 2.4; $p = pack $template, $nv; $s = "'$p'"; # Now pass $p to the 'double' build of perl. $double_perl = "C:/perl-5.34.0/bin/MSWin32-x64-multi-thread/perl.exe"; system $double_perl, '-wle', "print unpack('H*', $s);";