From: Jarkko Hietaniemi Date: Wed, 28 Jul 1999 20:29:17 +0000 (+0000) Subject: Continue pack() doc honing. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9ccd05c0c9fc3355a245e99f650407c76c593182;p=p5sagit%2Fp5-mst-13.2.git Continue pack() doc honing. p4raw-id: //depot/cfgperl@3823 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index edcb969..13ada36 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2923,11 +2923,10 @@ equal $foo). =item * You must yourself do any alignment or padding by inserting for example -enough C<'x'>es while packing. There is no way to they could know -from where the bytes are coming from, they might be coming from a -completely different system than the one your script is running in. -Therefore C (and C) handle their output and input as -flat sequences of bytes. +enough C<'x'>es while packing. There is no way to pack() and unpack() +could know where the bytes are going to or coming from. Therefore +C (and C) handle their output and input as flat +sequences of bytes. =back @@ -2943,6 +2942,11 @@ Examples: $foo = pack("ccxxcc",65,66,67,68); # foo eq "AB\0\0CD" + # note: the above examples featuring "C" and "c" are true + # only on ASCII and ASCII-derived systems such as ISO Latin 1 + # and UTF-8. In EBCDIC the first example would be + # $foo = pack("CCCC",193,194,195,196); + $foo = pack("s2",1,2); # "\1\0\2\0" on little-endian # "\0\1\0\2" on big-endian