This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
devel/scanprov: Extract code into a fcn
authorKarl Williamson <khw@cpan.org>
Mon, 29 Jul 2019 17:56:16 +0000 (11:56 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:51:27 +0000 (16:51 -0600)
This is in preparation for it being called from other places

(cherry picked from commit 56bf67b75f766a453aa2373db9f6f09935cbae2e)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/devel/scanprov

index 5ed3de8..4d26550 100755 (executable)
@@ -120,7 +120,14 @@ for my $v (keys %v) {
   $write and (open F, ">>$file" or die "$file: $!\n");
   for (@new) {
     print "adding $_\n";
-    $write and printf F "%-30s # added by $0\n", $_;
+    $write and print F format_output_line($_);
   }
   $write and close F;
 }
+
+sub format_output_line
+{
+    my $sym = shift;
+
+    return sprintf "%-30s # added by $0\n", $sym;
+}