diff options
author | John Peacock <jpeacock@rowman.com> | 2005-08-23 23:41:11 +0300 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-08-24 15:53:01 +0000 |
commit | e0218a61b599e8e5c97718ac68ef92ad34b20839 (patch) | |
tree | d49dbe4e2b1b595f58f31c9ee9067317b242f321 /lib/version.pm | |
parent | 80dc6883dac79eac16d48a9478d1423a03bd4025 (diff) | |
download | perl-e0218a61b599e8e5c97718ac68ef92ad34b20839.tar.gz |
[Fwd: CPAN Upload: J/JP/JPEACOCK/version-0.47.tar.gz]
From: "John Peacock" <jpeacock@rowman.com>
Message-ID: <2444.85.65.24.143.1124818871.squirrel@webmail.rowman.com>
p4raw-id: //depot/perl@25325
Diffstat (limited to 'lib/version.pm')
-rw-r--r-- | lib/version.pm | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/version.pm b/lib/version.pm index e6e4f3ee1f..1e3cabbb0d 100644 --- a/lib/version.pm +++ b/lib/version.pm @@ -12,7 +12,7 @@ use vars qw(@ISA $VERSION $CLASS @EXPORT); @EXPORT = qw(qv); -$VERSION = "0.44"; +$VERSION = "0.47"; $CLASS = 'version'; @@ -538,6 +538,28 @@ will also exclusively return the numified form. Technically, the $module->VERSION function returns a string (PV) that can be converted to a number following the normal Perl rules, when used in a numeric context. +=head1 SUBCLASSING + +This module is specifically designed and tested to be easily subclassed. +In practice, you only need to override the methods you want to change, but +you have to take some care when overriding new() (since that is where all +of the parsing takes place). For example, this is a perfect acceptable +derived class: + + package myversion; + use base version; + sub new { + my($self,$n)=@_; + my $obj; + # perform any special input handling here + $obj = $self->SUPER::new($n); + # and/or add additional hash elements here + return $obj; + } + +See also L<version::AlphaBeta> on CPAN for an alternate representation of +version strings. + =head1 EXPORT qv - quoted version initialization operator |