summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-01-21 15:06:19 +0000
committerNicholas Clark <nick@ccl4.org>2011-01-21 15:06:46 +0000
commitc0f8aaaaa842ec59ffd5f565760f0c9f7cfd674f (patch)
tree91cab6d7bae99beb659f7d43121ea431e03bc38b
parentb8ce93b8a63d4a20f1e6abe9661c46b41bcc0ea1 (diff)
downloadperl-c0f8aaaaa842ec59ffd5f565760f0c9f7cfd674f.tar.gz
In buildtoc, eliminate the now vestigial sub output.
-rw-r--r--pod/buildtoc39
1 files changed, 16 insertions, 23 deletions
diff --git a/pod/buildtoc b/pod/buildtoc
index 182de56d45..1f4cb00bf9 100644
--- a/pod/buildtoc
+++ b/pod/buildtoc
@@ -317,8 +317,6 @@ close MASTER;
# OK. Now a lot of ancillary function definitions follow
# Main program returns at "Do stuff"
-sub output ($);
-
my $OUT;
sub output_perltoc {
@@ -326,7 +324,7 @@ sub output_perltoc {
local $/ = '';
- ($_= <<"EOPOD2B") =~ s/^\t//gm && output($_);
+ ($_= <<"EOPOD2B") =~ s/^\t//gm and $OUT .= $_;
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is autogenerated by buildtoc from all the other pods.
@@ -353,7 +351,7 @@ EOPOD2B
}
- ($_= <<"EOPOD2B") =~ s/^\t//gm && output($_);
+ ($_= <<"EOPOD2B") =~ s/^\t//gm and $OUT .= $_;
@@ -365,7 +363,7 @@ EOPOD2B
podset($_, $Pragmata{$_});
}
- ($_= <<"EOPOD2B") =~ s/^\t//gm && output($_);
+ ($_= <<"EOPOD2B") =~ s/^\t//gm and $OUT .= $_;
@@ -403,8 +401,7 @@ EOPOD2B
EOPOD2B
s/^\t//gm;
- output $_;
- output "\n"; # flush $LINE
+ $OUT .= "$_\n";
$OUT =~ s/\n\s+\n/\n\n/gs;
$OUT =~ s/\n{3,}/\n\n/g;
@@ -429,30 +426,30 @@ sub podset {
tr/\015//d;
if (s/^=head1 (NAME)\s*/=head2 /) {
unhead1();
- output "\n\n=head2 ";
+ $OUT .= "\n\n=head2 ";
$_ = <$fh>;
# Remove svn keyword expansions from the Perl FAQ
s/ \(\$Revision: \d+ \$\)//g;
if ( /^\s*\Q$pod\E\b/ ) {
s/$pod\.pm/$pod/; # '.pm' in NAME !?
- output $_;
+ $OUT .= $_;
} else {
s/^/$pod, /;
- output $_;
+ $OUT .= $_;
}
next;
}
if (s/^=head1 (.*)/=item $1/) {
unhead2();
- output "=over 4\n\n" unless $inhead1;
+ $OUT .= "=over 4\n\n" unless $inhead1;
$inhead1 = 1;
- output "$_\n"; next;
+ $OUT .= "$_\n"; next;
}
if (s/^=head2 (.*)/=item $1/) {
unitem();
- output "=over 4\n\n" unless $inhead2;
+ $OUT .= "=over 4\n\n" unless $inhead2;
$inhead2 = 1;
- output "$_\n"; next;
+ $OUT .= "$_\n"; next;
}
if (s/^=item ([^=].*)/$1/) {
next if $pod eq 'perldiag';
@@ -462,11 +459,11 @@ sub podset {
s/\s+$//;
next if /^[\d.]+$/;
next if $pod eq 'perlmodlib' && /^ftp:/;
- output ", " if $initem;
+ $OUT .= ", " if $initem;
$initem = 1;
s/\.$//;
s/^-X\b/-I<X>/;
- output $_; next;
+ $OUT .= $_; next;
}
if (s/^=cut\s*\n//) {
unhead1();
@@ -478,7 +475,7 @@ sub podset {
sub unhead1 {
unhead2();
if ($inhead1) {
- output "\n\n=back\n\n";
+ $OUT .= "\n\n=back\n\n";
}
$inhead1 = 0;
}
@@ -486,22 +483,18 @@ sub unhead1 {
sub unhead2 {
unitem();
if ($inhead2) {
- output "\n\n=back\n\n";
+ $OUT .= "\n\n=back\n\n";
}
$inhead2 = 0;
}
sub unitem {
if ($initem) {
- output "\n\n";
+ $OUT .= "\n\n";
}
$initem = 0;
}
-sub output ($) {
- $OUT .= shift;
-}
-
# End of original buildtoc. From here on are routines to generate new sections
# for and inplace edit other files