X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlfunc.pod;h=d4215b63f4f059483a0ea18569e2f2d6632c0d82;hb=dd629d5bb3bd7014585b7aad3c6715a5011673bc;hp=ae1f44298d2ab59fcb09a252870841b840be22e7;hpb=f6c8478cc6cfc17dcb81770ef59a5e1c39269012;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index ae1f442..d4215b6 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -3549,9 +3549,18 @@ 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. If a version number or tuple is specified, or if EXPR is -numeric, demands that the current version of Perl -(C<$^V> or C<$]> or $PERL_VERSION) be equal or greater than EXPR. +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. + + require v5.6.1; # run time version check + require 5.6.1; # ditto + require 5.005_03; # float version allowed for 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 @@ -4381,7 +4390,7 @@ in arbitrary strings: printf "version is v%vd\n", $^V; # Perl's version printf "address is %*vX\n", ":", $addr; # IPv6 address - printf "bits are %*vb\n", "", $bits; # random bitstring + printf "bits are %*vb\n", " ", $bits; # random bitstring If C is in effect, the character used for the decimal point in formatted real numbers is affected by the LC_NUMERIC locale. @@ -5247,13 +5256,18 @@ package. It is exactly equivalent to except that Module I be a bareword. -If the first argument to C is a number or a version tuple, it is -treated as a version instead of a module name. If the version -of the Perl interpreter is less than VERSION, then an error message -is printed and Perl exits immediately. +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. - use 5.005_03; # version number - use v5.6.0; # version tuple + use v5.6.1; # compile time version check + use 5.6.1; # ditto + use 5.005_03; # float version allowed for 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 @@ -5280,7 +5294,7 @@ That is exactly equivalent to If the VERSION argument is present between Module and LIST, then the C will call the VERSION method in class Module with the given version as an argument. The default VERSION method, inherited from -the Universal class, croaks if the given version is larger than the +the UNIVERSAL class, croaks if the given version is larger than the value of the variable C<$Module::VERSION>. Again, there is a distinction between omitting LIST (C called