summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-07-28 20:29:17 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-07-28 20:29:17 +0000
commit9ccd05c0c9fc3355a245e99f650407c76c593182 (patch)
tree9ec56d2c69b1420c6a755ad26654e4489a253902
parent851646ae28fbfbd94e25648bf14d782e717e6d3c (diff)
downloadperl-9ccd05c0c9fc3355a245e99f650407c76c593182.tar.gz
Continue pack() doc honing.
p4raw-id: //depot/cfgperl@3823
-rw-r--r--pod/perlfunc.pod14
1 files changed, 9 insertions, 5 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index edcb969672..13ada36574 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<pack> (and C<unpack>) 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<pack> (and C<unpack>) 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