diff options
-rwxr-xr-x | preps/perl.d/perl-dist | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/preps/perl.d/perl-dist b/preps/perl.d/perl-dist index 748ce11..c6fa2e3 100755 --- a/preps/perl.d/perl-dist +++ b/preps/perl.d/perl-dist @@ -171,12 +171,11 @@ sub _perldepver # Fix perl-style vstrings which have a leading "v". return $perlver if($perlver =~ s/\Av//); - return $perlver unless($perlver =~ /\A(\d+)[.](\d{3})(\d{1,3})\z/); - # Re-apply the missing trailing zeroes. - my $patch = $3; - $patch .= q{0} x (3 - length $patch); - return sprintf('%d.%d.%d', $1, $2, $patch); + my @v; + return $perlver unless(@v = $perlver =~ /\A(\d+)[.](\d{1,3})(\d{0,3})\z/); + pop @v unless($v[2]); + return join q{.}, map { int } @v; # int removes zeroes } #---PUBLIC FUNCNTION--- |