X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlfunc.pod;h=81a42c2ab39fd3e0de243e3e503449e7f5a6078d;hb=491873e5975978ffc50c5af79581657c3f0e3068;hp=a7eaece801800410b2d588279bb66c3a5b000306;hpb=18bdf90ade8cd9b8918f6edac90115b5fbbe6fd3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index a7eaece..81a42c2 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -2687,10 +2687,13 @@ and you get list of anonymous hashes each with only 1 entry. =item mkdir FILENAME +=item mkdir + Creates the directory specified by FILENAME, with permissions specified by MASK (as modified by C). If it succeeds it returns true, otherwise it returns false and sets C<$!> (errno). -If omitted, MASK defaults to 0777. +If omitted, MASK defaults to 0777. If omitted, FILENAME defaults +to C<$_>. In general, it is better to create directories with permissive MASK, and let the user modify that with their C, than it is to supply @@ -3008,7 +3011,7 @@ Examples: } } -See L for detailed info on PerlIO. +See L for detailed info on PerlIO. You may also, in the Bourne shell tradition, specify an EXPR beginning with C<< '>&' >>, in which case the rest of the string is interpreted @@ -3358,15 +3361,16 @@ of values, as follows: U A Unicode character number. Encodes to UTF-8 internally (or UTF-EBCDIC in EBCDIC platforms). - w A BER compressed integer. Its bytes represent an unsigned - integer in base 128, most significant digit first, with as - few digits as possible. Bit eight (the high bit) is set - on each byte except the last. + w A BER compressed integer (not an ASN.1 BER, see perlpacktut for + details). Its bytes represent an unsigned integer in base 128, + most significant digit first, with as few digits as possible. Bit + eight (the high bit) is set on each byte except the last. x A null byte. X Back up a byte. - @ Null fill to absolute position, counted from the start of - the innermost ()-group. + @ Null fill or truncate to absolute position, counted from the + start of the innermost ()-group. + . Null fill or truncate to absolute position specified by value. ( Start of a ()-group. Some letters in the TEMPLATE may optionally be followed by one or @@ -3380,6 +3384,10 @@ which the modifier is valid): nNvV Treat integers as signed instead of unsigned. + @. Specify position as byte offset in the internal + representation of the packed string. Efficient but + dangerous. + > sSiIlLqQ Force big-endian byte-order on the type. jJfFdDpP (The "big end" touches the construct.) @@ -3398,12 +3406,13 @@ The following rules apply: Each letter may optionally be followed by a number giving a repeat count. With all types except C, C, C, C, C, C, -C, C<@>, C, C and C

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, C, where it is -equivalent to C<0>, and C, 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. +C, C<@>, C<.>, C, C and C

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, C, where it +is equivalent to C<0>, for <.> where it means relative to string start +and C, where it is equivalent to 1 (or 45, which is the same). +A numeric repeat count may optionally be enclosed in brackets, as in +C. 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. @@ -3417,6 +3426,17 @@ When used with C, C<*> results in the addition of a trailing null byte (so the packed result will be one longer than the byte C of the item). +When used with C<@>, the repeat count represents an offset from the start +of the innermost () group. + +When used with C<.>, the repeat count is used to determine the starting +position from where the value offset is calculated. If the repeat count +is 0, it's relative to the current position. If the repeat count is C<*>, +the offset is relative to the start of the packed string. And if its an +integer C the offset is relative to the start of the n-th innermost +() group (or the start of the string if C is bigger then the group +level). + The repeat count for C is interpreted as the maximal number of bytes to encode per line of output, with 0, 1 and 2 replaced by 45. The repeat count should not be more than 65. @@ -3689,7 +3709,6 @@ C<@> starts again at 0. Therefore, the result of is the string "\0a\0\0bc". - =item * C and C accept C modifier. In this case they act as @@ -3780,6 +3799,8 @@ Examples: $bar = pack('s@4l', 12, 34); # short 12, zero fill to position 4, long 34 # $foo eq $bar + $baz = pack('s.l', 12, 4, 34); + # short 12, zero fill to position 4, long 34 $foo = pack('nN', 42, 4711); # pack big-endian 16- and 32-bit unsigned integers @@ -4282,7 +4303,7 @@ a bareword argument, there is a little extra functionality going on behind the scenes. Before C looks for a "F<.pm>" extension, it will first look for a filename with a "F<.pmc>" extension. A file with this extension is assumed to be Perl bytecode generated by -L. If this file is found, and it's modification +L. If this file is found, and its modification time is newer than a coinciding "F<.pm>" non-compiled file, it will be loaded in place of that non-compiled file ending in a "F<.pm>" extension. @@ -4585,6 +4606,14 @@ Note that whether C. +On error, C, except as permitted by POSIX, and even then only on POSIX systems. You have to use C instead.