in reply to Re: pack() returns an unusable string
in thread pack() returns an unusable string
If that DWIMmed, it would output :use strict; use warnings; my $template = 'D<'; my $nv = 2.4; my $p = pack $template, $nv; # I'm running this script on perl-5.34.0 # with nvtype of 'long double'. # I want to see the result of perl-5.34.0 # with nvtype of 'double' unpacking $p : my $perl = "C:/perl-5.34.0/bin/MSWin32-x64-multi-thread/perl.exe"; system $perl, '-wle', 'print unpack("H*", $p)';
but, of course, all that it emits is the warning:9a999999999999990040000000000000
Sure, I could take a leaf out of your book and alter my last line to:Use of uninitialized value $_ in print at -e line 1.
But that unpack('H*', $p) is being evaluated by the 'long double' build of perl.system $perl, '-wle', 'print $ARGV[0]', unpack('H*', $p);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: pack() returns an unusable string
by ikegami (Patriarch) on May 29, 2021 at 23:19 UTC | |
by syphilis (Archbishop) on May 30, 2021 at 08:46 UTC | |
by ikegami (Patriarch) on May 31, 2021 at 17:58 UTC | |
by syphilis (Archbishop) on May 31, 2021 at 23:31 UTC | |
by ikegami (Patriarch) on Jun 05, 2021 at 01:55 UTC | |
by ikegami (Patriarch) on May 31, 2021 at 01:10 UTC |