X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlfunc.pod;h=86a09ba8dc45ab9b52c3f2160307d6cad2824aa9;hb=f1c09d8aea4b00e7799b7273c877df50e0fd657a;hp=50a02fef12a94e0dcfe80404c6a4e0089f184d91;hpb=e0b236fe86fb5fced9182a324010842ee938ca4c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 50a02fe..86a09ba 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -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 @@ -2133,7 +2134,8 @@ L.) If EXPR is omitted, uses C<$_>. print hex 'aF'; # same Hex strings may only represent integers. Strings that would cause -integer overflow trigger a warning. +integer overflow trigger a warning. Leading whitespace is not stripped, +unlike oct(). =item import @@ -2630,8 +2632,9 @@ See the L function, which C is the opposite of. Interprets EXPR as an octal string and returns the corresponding value. (If EXPR happens to start off with C<0x>, interprets it as a hex string. If EXPR starts off with C<0b>, it is interpreted as a -binary string.) The following will handle decimal, binary, octal, and -hex in the standard Perl or C notation: +binary string. Leading whitespace is ignored in all three cases.) +The following will handle decimal, binary, octal, and hex in the standard +Perl or C notation: $val = oct($val) if $val =~ /^0/; @@ -3753,19 +3756,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. -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. +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. + +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 @@ -3875,6 +3882,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 @@ -5454,9 +5464,8 @@ 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. Under Unicode it uses the standard Unicode -uppercase mappings. (It does not attempt to do titlecase mapping on -initial letters. See C for that.) +and L. It does not attempt to do titlecase mapping on +initial letters. See C for that. If EXPR is omitted, uses C<$_>. @@ -5639,18 +5648,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