diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-01-21 14:15:34 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-01-21 15:06:46 +0000 |
commit | d871876a3fe2d172e69b4d1b9b24f5111de2df99 (patch) | |
tree | dc3142a0154a8c7b0055f589efea3609f14676b5 /pod | |
parent | c43ae56ff9cdb8e0fb3d1724f564378b031a4d49 (diff) | |
download | perl-d871876a3fe2d172e69b4d1b9b24f5111de2df99.tar.gz |
In buildtoc, accumulate all perltoc.pod content before outputting it to disk.
Diffstat (limited to 'pod')
-rw-r--r-- | pod/buildtoc | 10 |
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++; } } |