X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlfunc.pod;h=8722105c2b6fa9beffc50b5e9ca9b9b71f1f974a;hb=1b1f1335be81080356b687a63b64fde210a3b697;hp=0761412f4ad49d23b0c7ee73c1beb719d835ad60;hpb=03e60089f91d0a4a765dc827f0f6b27465941491;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 0761412..8722105 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -291,7 +291,7 @@ X<-S>X<-b>X<-c>X<-t>X<-u>X<-g>X<-k>X<-T>X<-B>X<-M>X<-A>X<-C> -g File has setgid bit set. -k File has sticky bit set. - -T File is an ASCII text file. + -T File is an ASCII text file (heuristic guess). -B File is a "binary" file (opposite of -T). -M Age of file in days when script started. @@ -560,11 +560,12 @@ previous time C was called. =item chdir EXPR -Changes the working directory to EXPR, if possible. If EXPR is omitted, +Changes the working directory to EXPR, if possible. If EXPR is omitted, changes to the directory specified by C<$ENV{HOME}>, if set; if not, -changes to the directory specified by C<$ENV{LOGDIR}>. If neither is -set, C does nothing. It returns true upon success, false -otherwise. See the example under C. +changes to the directory specified by C<$ENV{LOGDIR}>. (Under VMS, the +variable C<$ENV{SYS$LOGIN}> is also checked, and used if it is set.) If +neither is set, C does nothing. It returns true upon success, +false otherwise. See the example under C. =item chmod LIST @@ -681,12 +682,12 @@ On POSIX systems, you can detect this condition this way: Returns the character represented by that NUMBER in the character set. For example, C is C<"A"> in either ASCII or Unicode, and -chr(0x263a) is a Unicode smiley face. Note that characters from -127 to 255 (inclusive) are not encoded in Unicode for backward -compatibility reasons. +chr(0x263a) is a Unicode smiley face. Note that characters from 127 +to 255 (inclusive) are by default not encoded in Unicode for backward +compatibility reasons (but see L). For the reverse, use L. -See L for more about Unicode. +See L and L for more about Unicode. If NUMBER is omitted, uses C<$_>. @@ -2329,7 +2330,7 @@ C work. Returns an lowercased version of EXPR. This is the internal function implementing the C<\L> escape in double-quoted strings. Respects current LC_CTYPE locale if C in force. See L -and L. +and L for more details about locale and Unicode support. If EXPR is omitted, uses C<$_>. @@ -2340,7 +2341,8 @@ If EXPR is omitted, uses C<$_>. Returns the value of EXPR with the first character lowercased. This is the internal function implementing the C<\l> escape in double-quoted strings. Respects current LC_CTYPE locale if C in force. See L and L. +locale> in force. See L and L for more +details about locale and Unicode support. If EXPR is omitted, uses C<$_>. @@ -2968,9 +2970,12 @@ DIRHANDLEs have their own namespace separate from FILEHANDLEs. =item ord -Returns the numeric (ASCII or Unicode) value of the first character of EXPR. If -EXPR is omitted, uses C<$_>. For the reverse, see L. -See L for more about Unicode. +Returns the numeric (the native 8-bit encoding, like ASCII or EBCDIC, +or Unicode) value of the first character of EXPR. If EXPR is omitted, +uses C<$_>. + +For the reverse, see L. +See L and L for more about Unicode. =item our EXPR @@ -3049,8 +3054,8 @@ sequence of characters that give the order and type of values, as follows: a A string with arbitrary binary data, will be null padded. - A An ASCII string, will be space padded. - Z A null terminated (asciz) string, will be null padded. + A A text (ASCII) string, will be space padded. + Z A null terminated (ASCIZ) string, will be null padded. b A bit string (ascending bit order inside each byte, like vec()). B A bit string (descending bit order inside each byte). @@ -3755,19 +3760,23 @@ rename(2) manpage or equivalent system documentation for details. =item require -Demands some semantics specified by EXPR, or by C<$_> if EXPR is not -supplied. +Demands a version of Perl specified by VERSION, or demands some semantics +specified by EXPR or by C<$_> if EXPR is not supplied. + +VERSION may be either a numeric argument such as 5.006, which will be +compared to C<$]>, or a literal of the form v5.6.1, which will be compared +to C<$^V> (aka $PERL_VERSION). A fatal error is produced at run time if +VERSION is greater than the version of the current Perl interpreter. +Compare with L, which can do a similar check at compile time. -If a VERSION is specified as a literal of the form v5.6.1, -demands that the current version of Perl (C<$^V> or $PERL_VERSION) be -at least as recent as that version, at run time. (For compatibility -with older versions of Perl, a numeric argument will also be interpreted -as VERSION.) Compare with L, which can do a similar check at -compile time. +Specifying VERSION as a literal of the form v5.6.1 should generally be +avoided, because it leads to misleading error messages under earlier +versions of Perl which do not support this syntax. The equivalent numeric +version should be used instead. require v5.6.1; # run time version check require 5.6.1; # ditto - require 5.005_03; # float version allowed for compatibility + require 5.006_001; # ditto; preferred for backwards compatibility Otherwise, demands that a library file be included if it hasn't already been included. The file is included via the do-FILE mechanism, which is @@ -3877,6 +3886,9 @@ C
.) Here is a typical code layout: # In the main program push @INC, new Foo(...); +Note that these hooks are also permitted to set the %INC entry +corresponding to the files they have loaded. See L. + For a yet-more-powerful import facility, see L and L. =item reset EXPR @@ -4103,7 +4115,7 @@ calling select() in scalar context just returns $nfound. Any of the bit masks can also be undef. The timeout, if specified, is in seconds, which may be fractional. Note: not all implementations are -capable of returning the$timeleft. If not, they always return +capable of returning the $timeleft. If not, they always return $timeleft equal to the supplied $timeout. You can effect a sleep of 250 milliseconds this way: @@ -5456,8 +5468,9 @@ otherwise. Returns an uppercased version of EXPR. This is the internal function implementing the C<\U> escape in double-quoted strings. Respects current LC_CTYPE locale if C in force. See L -and L. It does not attempt to do titlecase mapping on -initial letters. See C for that. +and L for more details about locale and Unicode support. +It does not attempt to do titlecase mapping on initial letters. See +C for that. If EXPR is omitted, uses C<$_>. @@ -5468,7 +5481,8 @@ If EXPR is omitted, uses C<$_>. Returns the value of EXPR with the first character in uppercase (titlecase in Unicode). This is the internal function implementing the C<\u> escape in double-quoted strings. Respects current LC_CTYPE -locale if C in force. See L and L. +locale if C in force. See L and L +for more details about locale and Unicode support. If EXPR is omitted, uses C<$_>. @@ -5640,18 +5654,21 @@ package. It is exactly equivalent to except that Module I be a bareword. -VERSION, which can be specified as a literal of the form v5.6.1, demands -that the current version of Perl (C<$^V> or $PERL_VERSION) be at least -as recent as that version. (For compatibility with older versions of Perl, -a numeric literal will also be interpreted as VERSION.) If the version -of the running Perl interpreter is less than VERSION, then an error -message is printed and Perl exits immediately without attempting to -parse the rest of the file. Compare with L, which can do a -similar check at run time. +VERSION may be either a numeric argument such as 5.006, which will be +compared to C<$]>, or a literal of the form v5.6.1, which will be compared +to C<$^V> (aka $PERL_VERSION. A fatal error is produced if VERSION is +greater than the version of the current Perl interpreter; Perl will not +attempt to parse the rest of the file. Compare with L, which can +do a similar check at run time. + +Specifying VERSION as a literal of the form v5.6.1 should generally be +avoided, because it leads to misleading error messages under earlier +versions of Perl which do not support this syntax. The equivalent numeric +version should be used instead. use v5.6.1; # compile time version check use 5.6.1; # ditto - use 5.005_03; # float version allowed for compatibility + use 5.006_001; # ditto; preferred for backwards compatibility This is often useful if you need to check the current Perl version before Cing library modules that have changed in incompatible ways from