http://qs321.pair.com?node_id=11133097


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 '.

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond