in reply to Re: pack() returns an unusable string
in thread pack() returns an unusable string
Guessing is sometimes fine, but the OP gave an entire and complete test script which you can examine and even run. If I make a small modification to the test script given we can test the theory:
# test.pl use warnings; $template = 'd<'; $nv = 2.4; $p = pack $template, $nv; $s = "'$p'"; print ">$s<\n"; system $^X, '-wle', "print unpack('H*', $s);";
prints:
>'333333@'< 3333333333330340
running a 64 bit build of 5.32. Note that there is an ETX character between the final 3 and the @ character, which, when you think about it, is the string that the unpack is showing us so for the success case there is a trailing @ and it isn't swallowing the trailing '.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: pack() returns an unusable string
by tybalt89 (Monsignor) on May 26, 2021 at 23:29 UTC | |
by choroba (Cardinal) on May 27, 2021 at 09:54 UTC |