in reply to Re^2: pack() returns an unusable string
in thread pack() returns an unusable string
OP said error only happens on D<, not d<, which doesn't run on my machine.
However, here is a number for which the error occurs on 5.32 with d<
#!/usr/bin/perl -l use strict; use warnings; my $template = 'd<'; my $nv = 2.4; $nv = 4135; # NOTE errors for this number my $p = pack $template, $nv; my $s = "'$p'"; print ">$s<\n"; system $^X, '-wle', "print unpack('H*', $s);";
Outputs:
>''°@'< Can't find string terminator "'" anywhere before EOF at -e line 1.
which shows that my guess that the pack produces a single quote character is plausible.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: pack() returns an unusable string
by choroba (Cardinal) on May 27, 2021 at 09:54 UTC |
In Section
Seekers of Perl Wisdom