diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 2002-02-21 16:33:37 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-22 01:56:06 +0000 |
commit | 206947d2c0ace466f6b1e79f9bf44a86d72fb50d (patch) | |
tree | a6afc3fc8dff78ce751dd986cce9b27dcb304cca /pod | |
parent | 445e6c975b30ffac31340f4bbc1d4513954992f8 (diff) | |
download | perl-206947d2c0ace466f6b1e79f9bf44a86d72fb50d.tar.gz |
pack with a human face: the sequel
Message-ID: <20020221213337.A23848@math.ohio-state.edu>
p4raw-id: //depot/perl@14824
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perldiag.pod | 6 | ||||
-rw-r--r-- | pod/perlfunc.pod | 18 |
2 files changed, 17 insertions, 7 deletions
diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 0c87d94643..6d8e9407f7 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2313,6 +2313,12 @@ supplied. See L<perlform>. of Perl. Check the #! line, or manually feed your script into Perl yourself. +=item %s not allowed in length fields + +(F) The count in the (un)pack template may be replaced by C<[TEMPLATE]> only if +C<TEMPLATE> always matches the same amount of packed bytes. Redesign +the template. + =item no UTC offset information; assuming local time is UTC (S) A warning peculiar to VMS. Perl was unable to find the local diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 56ad58f474..dfacad5146 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -3169,7 +3169,7 @@ of values, as follows: x A null byte. X Back up a byte. @ Null fill to absolute position. - ( Beginning of a ()-group. + ( Start of a ()-group. The following rules apply: @@ -3179,12 +3179,16 @@ The following rules apply: Each letter may optionally be followed by a number giving a repeat count. With all types except C<a>, C<A>, C<Z>, C<b>, C<B>, C<h>, -C<H>, and C<P> the pack function will gobble up that many values from -the LIST. A C<*> for the repeat count means to use however many items are -left, except for C<@>, C<x>, C<X>, where it is equivalent -to C<0>, and C<u>, where it is equivalent to 1 (or 45, what is the -same). A numeric repeat count may optionally be enclosed in brackets, as in -C<pack 'C[80]', @arr>. +C<H>, C<@>, C<x>, C<X> and C<P> the pack function will gobble up that +many values from the LIST. A C<*> for the repeat count means to use +however many items are left, except for C<@>, C<x>, C<X>, where it is +equivalent to C<0>, and C<u>, where it is equivalent to 1 (or 45, what +is the same). A numeric repeat count may optionally be enclosed in +brackets, as in C<pack 'C[80]', @arr>. + +One can replace the numeric repeat count by a template enclosed in brackets; +then the packed length of this template in bytes is used as a count. +For example, C<x[L]> skips a long (it skips the number of bytes in a long). When used with C<Z>, C<*> results in the addition of a trailing null byte (so the packed result will be one longer than the byte C<length> |