summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-04-20 22:32:45 +0100
committerNicholas Clark <nick@ccl4.org>2009-04-20 22:32:45 +0100
commit0fdd9e5c247d37cfd88b86ddf6bd630719de5904 (patch)
treeec686e2cfe441245479bc260c212d63d39255bdc
parent08115d9c481d157adc084512230d35dc4c0407c5 (diff)
downloadperl-0fdd9e5c247d37cfd88b86ddf6bd630719de5904.tar.gz
In corelist.pl, refactor to avoid repeating the final output formatting string.
-rw-r--r--Porting/corelist.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/Porting/corelist.pl b/Porting/corelist.pl
index 5c25d0a963..b8b74b3d26 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";