in reply to pack() returns an unusable string

Your problem is unrelated to pack and can be easily demonstrated without it:
my $p = "X\x00Y"; system $^X, '-wE', "say '$p'";

The problem is the zero byte in an argument (at least on Linux).

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]