summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-01-21 14:15:34 +0000
committerNicholas Clark <nick@ccl4.org>2011-01-21 15:06:46 +0000
commitd871876a3fe2d172e69b4d1b9b24f5111de2df99 (patch)
treedc3142a0154a8c7b0055f589efea3609f14676b5 /pod
parentc43ae56ff9cdb8e0fb3d1724f564378b031a4d49 (diff)
downloadperl-d871876a3fe2d172e69b4d1b9b24f5111de2df99.tar.gz
In buildtoc, accumulate all perltoc.pod content before outputting it to disk.
Diffstat (limited to 'pod')
-rw-r--r--pod/buildtoc10
1 files changed, 7 insertions, 3 deletions
diff --git a/pod/buildtoc b/pod/buildtoc
index 4b9d9e6ba0..2131bcd2c4 100644
--- a/pod/buildtoc
+++ b/pod/buildtoc
@@ -319,9 +319,10 @@ close MASTER;
sub output ($);
+my $OUT;
+
sub output_perltoc {
my $filename = shift;
- open OUT, '>', $filename or die "$0: creating $filename failed: $!";
local $/ = '';
@@ -404,6 +405,9 @@ EOPOD2B
s/^\t//gm;
output $_;
output "\n"; # flush $LINE
+
+ open OUT, '>', $filename or die "$0: creating $filename failed: $!";
+ print OUT $OUT;
close OUT;
}
@@ -496,11 +500,11 @@ sub output ($) {
for (split /(\n)/, shift) {
if ($_ eq "\n") {
if ($LINE) {
- print OUT wrap('', '', $LINE);
+ $OUT .= wrap('', '', $LINE);
$LINE = '';
}
if (($NEWLINE) < 2) {
- print OUT;
+ $OUT .= $_;
$NEWLINE++;
}
}