summaryrefslogtreecommitdiff
path: root/lib/version.pm
diff options
context:
space:
mode:
authorJohn Peacock <jpeacock@rowman.com>2002-10-10 17:23:01 -0400
committerhv <hv@crypt.org>2002-10-17 14:29:41 +0000
commit46314c133ffe2db9038a340b36533579af4603b9 (patch)
tree4fe5fbd35644f6ace09758d739626ea4e99e68a7 /lib/version.pm
parent09448d78b3a7197d822f3a4cddd3020b529656e9 (diff)
downloadperl-46314c133ffe2db9038a340b36533579af4603b9.tar.gz
Re: [PATCH] Version object combined patch
Message-ID: <3DA627F5.5050907@rowman.com> p4raw-id: //depot/perl@18026
Diffstat (limited to 'lib/version.pm')
-rw-r--r--lib/version.pm23
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/version.pm b/lib/version.pm
index 63d25acad7..06476487d9 100644
--- a/lib/version.pm
+++ b/lib/version.pm
@@ -9,7 +9,7 @@ use vars qw(@ISA $VERSION $CLASS);
@ISA = qw(DynaLoader);
-$VERSION = (qw$Revision: 2.1 $)[1]/10;
+$VERSION = (qw$Revision: 2.2 $)[1]/10;
$CLASS = 'version';
@@ -55,6 +55,22 @@ single underscore. This corresponds to what Perl itself uses for a
version, as well as extending the "version as number" that is discussed
in the various editions of the Camel book.
+However, in order to be compatible with earlier Perl version styles,
+any use of versions of the form 5.006001 will be translated as 5.6.1,
+In other words a version with a single decimal place will be parsed
+as implicitely having three places between subversion.
+
+Any value passed to the new() operator will be parsed only so far as it
+contains a numeric, decimal, or underscore character. So, for example:
+
+ $v1 = new version "99 and 94/100 percent pure"; # $v1 == 99.0
+ $v2 = new version "something"; # $v2 == "" and $v2->numify == 0
+
+NOTE: it is strongly recommended that version objects only be created
+with numeric values based on the different types of versions in this
+documentation, see L<"Types of Versions Objects">. That way, there is
+no confusion about what constitutes the version.
+
=head2 Object Methods
Overloading has been used with version objects to provide a natural
@@ -160,11 +176,6 @@ have only two. This allows you to automatically increment
your module version by using the Revision number from the primary
file in a distribution, see L<ExtUtils::MakeMaker/"VERSION_FROM">.
-In order to be compatible with earlier Perl version styles, any use
-of versions of the form 5.006001 will be translated as 5.6.1, In
-other words a version with a single decimal place will be parsed
-as implicitely having three places between subversion.
-
=item * Beta versions - For module authors using CPAN, the
convention has been to note unstable releases with an underscore
in the version string, see L<CPAN>. Beta releases will test as being