summaryrefslogtreecommitdiff
path: root/pod/buildtoc
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-12-18 15:03:18 +0100
committerNicholas Clark <nick@ccl4.org>2011-12-19 13:55:19 +0100
commit4027e27b35630b1e4213355d1223d476fa09a600 (patch)
tree5b10fc4805ea0879fa65b925ca012564c792464f /pod/buildtoc
parent9887f4486771327e32cc7026d4b939cc89ccc7b2 (diff)
downloadperl-4027e27b35630b1e4213355d1223d476fa09a600.tar.gz
Prime the duplicate Pod cache the first time is_duplicate_pod() is called.
Previously it was primed when get_pod_metadata() was called. This removes the undocumented assumption that is_duplicate_pod() will only be called after get_pod_metadata(), and avoids reading 14 Pod files to calculate their MD5s unless actually necessary. This change means that the array references in @{$state{master}} are being accessed much later during runtime. This reveals that podset() in buildtoc had been clobbering its callers $_, which happened to be an alias to the current element of @{$state{master}}.
Diffstat (limited to 'pod/buildtoc')
-rw-r--r--pod/buildtoc1
1 files changed, 1 insertions, 0 deletions
diff --git a/pod/buildtoc b/pod/buildtoc
index 839fbb16a4..c61a425c85 100644
--- a/pod/buildtoc
+++ b/pod/buildtoc
@@ -223,6 +223,7 @@ sub podset {
my ($pod, $file) = @_;
local $/ = '';
+ local *_;
open my $fh, '<', $file or my_die "Can't open file '$file' for $pod: $!";