summaryrefslogtreecommitdiff
path: root/pod/perlfunc.pod
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-21 21:10:26 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-21 21:10:26 +0000
commit44dcb63b0bb49fa80a224080c0601a2af7b94275 (patch)
treed792893c44395e342cddd5c15c89529d3f7fef11 /pod/perlfunc.pod
parentf6c8478cc6cfc17dcb81770ef59a5e1c39269012 (diff)
downloadperl-44dcb63b0bb49fa80a224080c0601a2af7b94275.tar.gz
remove dual-valueness of v-strings (i.e., they are pure strings
now); avoid the word "tuple" to describe strings represented as character ordinals; usurp $PERL_VERSION for $^V as suggested by Larry, deprecate $] ; adjust the documentation and testsuite accordingly p4raw-id: //depot/perl@5186
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r--pod/perlfunc.pod32
1 files changed, 22 insertions, 10 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index ae1f44298d..f4cee09073 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -3549,9 +3549,17 @@ 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.0,
+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</use>, which can do a similar check at
+compile time.
+
+ require v5.6.0; # run time version check
+ require 5.005_03; # same, number still supported 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
@@ -5247,13 +5255,17 @@ package. It is exactly equivalent to
except that Module I<must> be a bareword.
-If the first argument to C<use> 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.0, 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</require>, which can do a
+similar check at run time.
- use 5.005_03; # version number
- use v5.6.0; # version tuple
+ use v5.6.0; # compile time version check
+ use 5.005_03; # same, number still supported for compatibility
This is often useful if you need to check the current Perl version before
C<use>ing library modules that have changed in incompatible ways from
@@ -5280,7 +5292,7 @@ That is exactly equivalent to
If the VERSION argument is present between Module and LIST, then the
C<use> 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<import> called