[Fwd: CPAN Upload: J/JP/JPEACOCK/version-0.47.tar.gz]
[p5sagit/p5-mst-13.2.git] / lib / version.pm
index d2648d1..1e3cabb 100644 (file)
@@ -12,7 +12,7 @@ use vars qw(@ISA $VERSION $CLASS @EXPORT);
 
 @EXPORT = qw(qv);
 
-$VERSION = "0.43"; 
+$VERSION = "0.47"; 
 
 $CLASS = 'version';
 
@@ -152,7 +152,7 @@ purposes of comparison with other version objects.  For example:
   $v = version->new( 1.002_03);    # 1.2.30   See "Quoting"
   $v = version->new( 1.002003);    # 1.2.3
 
-All of the preceeding examples except the second to last are true
+All of the preceding examples except the second to last are true
 whether or not the input value is quoted.  The important feature is that
 the input value contains only a single decimal.
 
@@ -379,7 +379,7 @@ notation and stick with it, to reduce confusion.  Perl6 version objects
 B<may> only support numeric comparisons.  See also L<"Quoting">.
 
 WARNING: Comparing version with unequal numbers of decimal places (whether
-explicitely or implicitely initialized), may yield unexpected results at
+explicitly or implicitly initialized), may yield unexpected results at
 first glance.  For example, the following inequalities hold:
 
   version->new(0.96)     > version->new(0.95); # 0.960.0 > 0.950.0
@@ -485,7 +485,7 @@ obeys the relationship
 
 Alpha versions with a single decimal place will be treated exactly as if
 they were L<Numeric Versions>, for parsing purposes.  The stringification for
-alpha versions with a single decimal place may seem suprising, since any
+alpha versions with a single decimal place may seem surprising, since any
 trailing zeros will visible.  For example, the above $alphaver will print as
 
   12.03_0100
@@ -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