=head1 VERSION
-Version 0.10
+Version 0.11
=cut
-our $VERSION = '0.10';
+our $VERSION = '0.11';
=head1 DESCRIPTION
my $letter_rx = qr/[a-zA-Z]/;
my $dotted_num_rx = qr/$int_rx(?:\.$int_rx)*/o;
-my @suffixes = qw(alpha beta pre rc normal p);
+my @suffixes = qw<alpha beta pre rc normal p>;
my $suffix_rx = join '|', grep !/^normal$/, @suffixes;
$suffix_rx = qr/(?:$suffix_rx)/o;
my @parts;
BEGIN {
- @parts = qw/version letter suffixes revision/;
+ @parts = qw<version letter suffixes revision>;
eval "sub $_ { \$_[0]->{$_} }" for @parts;
}
my @a = @{ $v1->version };
my @b = @{ $v2->version };
- while (@a or @b) {
- my $x = shift(@a) || 0;
- my $y = shift(@b) || 0;
+ while (@a and @b) {
+ my $x = shift @a;
+ my $y = shift @b;
my $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