summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Golden <dagolden@cpan.org>2010-01-19 10:14:32 -0500
committerDavid Golden <dagolden@cpan.org>2010-01-19 10:14:32 -0500
commitbd12309b58376140a53f4d708bb325f48df1ff70 (patch)
tree2ac25a970d843022f8bdf6c993fcd3d452d1f7bf
parent916254008628ddf01ee5de6c872bd94a9b535593 (diff)
downloadperl-bd12309b58376140a53f4d708bb325f48df1ff70.tar.gz
note strict/lax version requirements in documentation
-rw-r--r--lib/UNIVERSAL.pm4
-rw-r--r--pod/perlfunc.pod16
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/UNIVERSAL.pm b/lib/UNIVERSAL.pm
index 35297431ec..d11b893db9 100644
--- a/lib/UNIVERSAL.pm
+++ b/lib/UNIVERSAL.pm
@@ -165,7 +165,9 @@ block or C<blessed> if you need to be extra paranoid.
C<VERSION> will return the value of the variable C<$VERSION> in the
package the object is blessed into. If C<REQUIRE> is given then
it will do a comparison and die if the package version is not
-greater than or equal to C<REQUIRE>.
+greater than or equal to C<REQUIRE>. Both C<$VERSION> or C<REQUIRE>
+must be "lax" version numbers (as defined by the L<version> module)
+or C<VERSION> will die with an error.
C<VERSION> can be called as either a class (static) method or an object
method.
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index faa3eeae25..210aab4a4f 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -4185,10 +4185,12 @@ package as assumed. That is, C<$::sail> is equivalent to
C<$main::sail> (as well as to C<$main'sail>, still seen in ancient
code, mostly from Perl 4).
-If VERSION is provided, C<package> sets the C<$VERSION> variable in the
-given namespace. VERSION must be a numeric literal or v-string; it is
-parsed the same way the VERSION argument in C<use MODULE VERSION> is.
-Set C<$VERSION> only once per package.
+If VERSION is provided, C<package> sets the C<$VERSION> variable in the given
+namespace. VERSION must be a "strict" style version number as defined by the
+L<version> module: a positive decimal number (integer or decimal-fraction)
+without exponentiation or else a dotted-decimal v-string with a leading 'v'
+character and at least three components. You should set C<$VERSION> only once
+per package.
See L<perlmod/"Packages"> for more information about packages, modules,
and classes. See L<perlsub> for other scoping issues.
@@ -7058,9 +7060,9 @@ package. It is exactly equivalent to
except that Module I<must> be a bareword.
-In the peculiar C<use VERSION> form, 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). An
+In the peculiar C<use VERSION> form, VERSION may be either a positive
+decimal fraction such as 5.006, which will be compared to C<$]>, or a v-string
+of the form v5.6.1, which will be compared to C<$^V> (aka $PERL_VERSION). An
exception is raised 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</require>, which can do a similar check at run time.