summaryrefslogtreecommitdiff
path: root/pod/perlfunc.pod
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1999-09-22 15:41:30 -0400
committerGurusamy Sarathy <gsar@cpan.org>1999-09-23 06:44:42 +0000
commit17f4a12df9ef6ee2f0a77e96071b3f12999159f0 (patch)
tree8a8b13d7eda2a4df6ff788a2e607177efcfd5a5c /pod/perlfunc.pod
parentde0d19685a431728abc301db6a7957ad399d5e5f (diff)
downloadperl-17f4a12df9ef6ee2f0a77e96071b3f12999159f0.tar.gz
change "#" to a comment starter in pack templates; "/" now
used for specifying counted types Message-ID: <19990922194130.A864@monk.mps.ohio-state.edu> Subject: [PATCH 5.005_61] Enable comments in pack()/unpack() templates p4raw-id: //depot/perl@4222
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r--pod/perlfunc.pod14
1 files changed, 9 insertions, 5 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 230dcd5c5e..237a38ddf8 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -2809,9 +2809,9 @@ C<"P"> is C<undef>.
=item *
-The C<"#"> character allows packing and unpacking of strings where the
+The C<"/"> character allows packing and unpacking of strings where the
packed structure contains a byte count followed by the string itself.
-You write I<length-item>C<#>I<string-item>.
+You write I<length-item>C</>I<string-item>.
The I<length-item> can be any C<pack> template letter,
and describes how the length value is packed.
@@ -2823,9 +2823,9 @@ The I<string-item> must, at present, be C<"A*">, C<"a*"> or C<"Z*">.
For C<unpack> the length of the string is obtained from the I<length-item>,
but if you put in the '*' it will be ignored.
- unpack 'C#a', "\04Gurusamy"; gives 'Guru'
- unpack 'a3#A* A*', '007 Bond J '; gives (' Bond','J')
- pack 'n#a* w#a*','hello,','world'; gives "\000\006hello,\005world"
+ unpack 'C/a', "\04Gurusamy"; gives 'Guru'
+ unpack 'a3/A* A*', '007 Bond J '; gives (' Bond','J')
+ pack 'n/a* w/a*','hello,','world'; gives "\000\006hello,\005world"
The I<length-item> is not returned explicitly from C<unpack>.
@@ -2931,6 +2931,10 @@ 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.
+=item *
+
+A comment in a TEMPLATE starts with C<#> and goes to the end of line.
+
=back
Examples: