This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
parts/apicheck.pl: Convert to use parse_version
authorKarl Williamson <khw@cpan.org>
Sat, 20 Jul 2019 21:00:56 +0000 (15:00 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:39:31 +0000 (16:39 -0600)
This function is now suitable here, instead of duplicating logic

(cherry picked from commit 9a55a3a3baf52d0d53571f576f6dc69d915220eb)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/parts/apicheck.pl

index 425f620..1e4dee5 100644 (file)
@@ -364,13 +364,7 @@ HEAD
 
   # #ifdef out if marked as todo (not known in) this version
   if ($todo{$f->{'name'}}) {
-    my($ver,$sub) = $todo{$f->{'name'}} =~ /^5\.(\d{3})(\d{2,3})$/ or die;
-    for ($ver, $sub) {
-      s/^0+(\d)/$1/
-    }
-    if ($ver < 6 && $sub > 0) {
-      #$sub =~ s/0$// or die;
-    }
+    my($five, $ver,$sub) = parse_version($todo{$f->{'name'}});
     print OUT "#if PERL_VERSION > $ver || (PERL_VERSION == $ver && PERL_SUBVERSION >= $sub) /* TODO */\n";
   }