=head1 VERSION
-Version 0.10
+Version 0.11
=cut
-our $VERSION = '0.10';
+our $VERSION = '0.11';
=head1 DESCRIPTION
my @a = @{ $v1->version };
my @b = @{ $v2->version };
- while (@a or @b) {
- my $x = shift(@a) || 0;
- my $y = shift(@b) || 0;
+ {
+ my $x = shift @a;
+ my $y = shift @b;
my $c = $x <=> $y;
return $c if $c;
}
+
+ while (@a and @b) {
+ my $x = shift @a;
+ my $y = shift @b;
+ my $c;
+ if ($x =~ /^0/ or $y =~ /^0/) {
+ s/0+\z// for $x, $y;
+ $c = $x cmp $y;
+ } else {
+ $c = $x <=> $y;
+ }
+ return $c if $c;
+ }
+
+ return 1 if @a;
+ return -1 if @b;
}
{
=pod
-This class provides overloaded methods for numerical comparison and strigification.
+This class provides overloaded methods for numerical comparison and stringification.
=head1 SEE ALSO