[Fwd: CPAN Upload: J/JP/JPEACOCK/version-0.47.tar.gz]
[p5sagit/p5-mst-13.2.git] / lib / version.pm
index e6e4f3e..1e3cabb 100644 (file)
@@ -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