summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-12-19 08:14:23 +0100
committerNicholas Clark <nick@ccl4.org>2011-12-19 13:55:20 +0100
commit64587559855c21e8c37df06060b2fc1b38d06867 (patch)
tree62c9da769607c0431d68d4d24990b85554caf956
parentd6a39ee219352c8fc402faf6a553b9669b197013 (diff)
downloadperl-64587559855c21e8c37df06060b2fc1b38d06867.tar.gz
Some pod_lib.pl cleanups.
Eliminate the file-scoped lexical %Readmepods. Use slurp_or_die() instead of coding it longhand.
-rw-r--r--Porting/pod_lib.pl13
1 files changed, 6 insertions, 7 deletions
diff --git a/Porting/pod_lib.pl b/Porting/pod_lib.pl
index a40bdb4d3b..95bea6114b 100644
--- a/Porting/pod_lib.pl
+++ b/Porting/pod_lib.pl
@@ -46,8 +46,6 @@ my %state = (
},
);
-my %Readmepods;
-
{
my (%Lengths, %MD5s);
@@ -77,8 +75,7 @@ my %Readmepods;
sub __prime_state {
my $source = 'perldelta.pod';
my $filename = "pod/$source";
- my $fh = open_or_die($filename);
- my $contents = do {local $/; <$fh>};
+ my $contents = slurp_or_die($filename);
my @want =
$contents =~ /perldelta - what is new for perl v(5)\.(\d+)\.(\d+)\n/;
die "Can't extract version from $filename" unless @want;
@@ -125,7 +122,7 @@ sub __prime_state {
if ($flags =~ tr/r//d) {
my $readme = $podname;
$readme =~ s/^perl//;
- $Readmepods{$podname} = $state{readmes}{$readme} = $desc;
+ $state{readmes}{$readme} = $desc;
$flags{readme} = 1;
} elsif ($flags{aux}) {
$state{aux}{$podname} = $desc;
@@ -175,8 +172,10 @@ sub get_pod_metadata {
= map { ( "$_.pod" => 1 ) } qw( perlboot perlbot perltooc perltoot );
# Convert these to a list of filenames.
- foreach (keys %{$state{pods}}, keys %Readmepods) {
- $our_pods{"$_.pod"}++;
+ ++$our_pods{"$_.pod"} foreach keys %{$state{pods}};
+ foreach (@{$state{master}}) {
+ ++$our_pods{"$_->[1].pod"}
+ if defined $_ && @$_ == 5 && $_->[0]{readme};
}
opendir my $dh, 'pod';