From: Paul Marquess Date: Sun, 10 Aug 1997 10:54:01 +0000 (+1200) Subject: doc patch for pack("p",undef) packing a NULL pointer X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=61167c6fd6d55c5f975404dcb56c3d0a87cd2c21;p=p5sagit%2Fp5-mst-13.2.git doc patch for pack("p",undef) packing a NULL pointer I just noticed that the new feature where pack p/P will generate a NULL pointer when given undef isn't documented anywhere. So here is a patch p5p-msgid: 9708102159.AA11726@claudius.bfsec.bt.co.uk --- diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 0679822..8d191e8 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -402,6 +402,9 @@ provides seven bits of the total value, with the most significant first. Bit eight of each byte is set, except for the last byte, in which bit eight is clear. +If 'p' or 'P' are given undef as values, they now generate a NULL +pointer. + Both pack() and unpack() now fail when their templates contain invalid types. (Invalid types used to be ignored.) diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 4bf1fda..8f8424b 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2160,7 +2160,9 @@ string that many nybbles long. The "p" type packs a pointer to a null- terminated string. You are responsible for ensuring the string is not a temporary value (which can potentially get deallocated before you get around to using the packed result). The "P" packs a pointer to a structure -of the size indicated by the length. Real numbers (floats and doubles) are +of the size indicated by the length. A NULL pointer is created if the +corresponding value for "p" or "P" is C. +Real numbers (floats and doubles) are in the native machine format only; due to the multiplicity of floating formats around, and the lack of a standard "network" representation, no facility for interchange has been made. This means that packed floating