From: Nicholas Clark <nick@ccl4.org>
Date: Mon, 20 Apr 2009 21:32:45 +0000 (+0100)
Subject: In corelist.pl, refactor to avoid repeating the final output formatting string.
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0fdd9e5c247d37cfd88b86ddf6bd630719de5904;p=p5sagit%2Fp5-mst-13.2.git

In corelist.pl, refactor to avoid repeating the final output formatting string.
---

diff --git a/Porting/corelist.pl b/Porting/corelist.pl
index 5c25d0a..b8b74b3 100644
--- a/Porting/corelist.pl
+++ b/Porting/corelist.pl
@@ -33,16 +33,18 @@ find(sub {
 	    );
     $module =~ s{/}{::}g;
     $module =~ s/(\.pm|_pm\.PL)$//;
-    $lines{sprintf "\t%-24s=> $version,\n", "'$module'"}++;
+    $lines{$module} = $version;
 }, 'lib', 'ext', 'vms/ext', 'symbian/ext');
 
--e 'configpm' and $lines{sprintf "\t%-24s=> undef,\n", "'Config'"}++;
+-e 'configpm' and $lines{Config} = 'undef';
 
 if (open my $ucdv, "<", "lib/unicore/version") {
     chomp (my $ucd = <$ucdv>);
-    $lines{sprintf "\t%-24s=> '$ucd',\n", "'Unicode'"}++;
+    $lines{Unicode} = "'$ucd'";
     close $ucdv;
     }
 print "    $] => {\n";
-print sort keys %lines;
+foreach (sort keys %lines) {
+    printf "\t%-24s=> $lines{$_},\n", "'$_'";
+}
 print "    },\n";