From: David Golden Date: Tue, 19 Jan 2010 15:14:32 +0000 (-0500) Subject: note strict/lax version requirements in documentation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bd12309b58376140a53f4d708bb325f48df1ff70;p=p5sagit%2Fp5-mst-13.2.git note strict/lax version requirements in documentation --- diff --git a/lib/UNIVERSAL.pm b/lib/UNIVERSAL.pm index 3529743..d11b893 100644 --- a/lib/UNIVERSAL.pm +++ b/lib/UNIVERSAL.pm @@ -165,7 +165,9 @@ block or C if you need to be extra paranoid. C will return the value of the variable C<$VERSION> in the package the object is blessed into. If C is given then it will do a comparison and die if the package version is not -greater than or equal to C. +greater than or equal to C. Both C<$VERSION> or C +must be "lax" version numbers (as defined by the L module) +or C will die with an error. C can be called as either a class (static) method or an object method. diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index faa3eea..210aab4 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 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 is. -Set C<$VERSION> only once per package. +If VERSION is provided, C sets the C<$VERSION> variable in the given +namespace. VERSION must be a "strict" style version number as defined by the +L 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 for more information about packages, modules, and classes. See L for other scoping issues. @@ -7058,9 +7060,9 @@ package. It is exactly equivalent to except that Module I be a bareword. -In the peculiar C 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 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, which can do a similar check at run time.