summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Marquess <pmarquess@bfsec.bt.co.uk>1997-08-10 22:54:01 +1200
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-09-05 00:00:00 +1200
commit61167c6fd6d55c5f975404dcb56c3d0a87cd2c21 (patch)
tree5f09794f96801f90e890583d70fe76bf05f65a89
parentd1a7f0f436d72614358862f92db9613296be2744 (diff)
downloadperl-61167c6fd6d55c5f975404dcb56c3d0a87cd2c21.tar.gz
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
-rw-r--r--pod/perldelta.pod3
-rw-r--r--pod/perlfunc.pod4
2 files changed, 6 insertions, 1 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 067982258f..8d191e82d7 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 4bf1fdabb1..8f8424b19d 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<undef>.
+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