diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1997-01-04 17:44:00 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-01-04 17:44:00 +1200 |
commit | 8ebc5c0145d2e3559bce3073437e6d027dcdffcc (patch) | |
tree | 19e91b8b9e9b19b4116b7b4b64f2a4755e6bd179 /pod/buildtoc | |
parent | 7cfe7857715f78206e6d7d6f7fd52983de4dec44 (diff) | |
download | perl-8ebc5c0145d2e3559bce3073437e6d027dcdffcc.tar.gz |
[inseparable changes from patch from perl5.003_18 to perl5.003_19]
CORE LANGUAGE CHANGES
Subject: Make method cache invisible to user code
From: Chip Salzenberg <chip@atlantic.net>
Files: dump.c gv.c gv.h hv.c op.c perl.c pp_hot.c pp_sys.c sv.c toke.c
Subject: Never parse "{m,s,y,tr,q{,q,w,x}}:{,:}" as package or label
From: Chip Salzenberg <chip@atlantic.net>
Files: toke.c
CORE PORTABILITY
Subject: Fix $^X under HP-UX
From: Chip Salzenberg <chip@atlantic.net>
Files: hints/hpux.sh toke.c
Subject: New hints/hpux.sh
Date: Tue, 31 Dec 1996 15:09:32 -0800
From: Jeff Okamoto <okamoto@hpcc123.corp.hp.com>
Files: hints/hpux.sh
private-msgid: <199612312309.AA283393772@hpcc123.corp.hp.com>
DOCUMENTATION
Subject: Perlguts, version 28
Date: Fri, 3 Jan 1997 13:10:46 -0800
From: Jeff Okamoto <okamoto@hpcc123.corp.hp.com>
Files: pod/perlguts.pod
private-msgid: <199701032110.AA102535846@hpcc123.corp.hp.com>
Subject: Miscellaneous pod patches
From: Ralf S. Engelschall <rse@engelschall.com>
Files: pod/Makefile pod/perldebug.pod pod/perlfunc.pod pod/perlguts.pod
Subject: expanded flock() docs
Date: Fri, 03 Jan 1997 19:31:11 -0500
From: Roderick Schertler <roderick@gate.net>
Files: pod/perlfunc.pod
Msg-ID: <4481.852337871@eeyore.ibcinc.com>
(applied based on p5p patch as commit 1fd81fbbe87d964ad1f7dbdce41e36f3781dcf82)
Subject: Use Text::Wrap in buildtoc; run buildtoc
From: Ulrich Pfeifer <pfeifer@charly.informatik.uni-dortmund.de>
Files: pod/buildtoc pod/perltoc.pod
Subject: Remove obsolete perlovl.pod
From: Chip Salzenberg <chip@atlantic.net>
Files: MANIFEST plan9/mkfile pod/perlovl.pod vms/Makefile vms/descrip.mms
OTHER CORE CHANGES
Subject: Fix segv when calling named closures
From: Chip Salzenberg <chip@atlantic.net>
Files: pp_hot.c
Subject: Finish rationalizing "undef value" warnings
From: Chip Salzenberg <chip@atlantic.net>
Files: doop.c pp.c sv.c t/op/assignwarn.t
Subject: Arrange for all "_<file" entries to be in %main::
From: Chip Salzenberg <chip@atlantic.net>
Files: gv.c lib/perl5db.pl
Subject: Introduce CVf_NODEBUG flag
Date: Wed, 01 Jan 1997 15:42:05 -0500
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Files: cv.h pp_hot.c
Msg-ID: <199701012042.PAA25994@aatma.engin.umich.edu>
(applied based on p5p patch as commit a3d90dd510fe5a67ed9b80e603493d285c30aa97)
Subject: Reword 'may be "0"' warning per Larry; fix its line number
From: Chip Salzenberg <chip@atlantic.net>
Files: op.c pod/perldiag.pod
Subject: 5.003_18: perl_{con,des}truct fixes
Date: Fri, 03 Jan 1997 15:42:04 -0500
From: Doug MacEachern <dougm@osf.org>
Files: perl.c perl.h pod/perlembed.pod pod/perltoc.pod t/op/sysio.t
Msg-ID: <199701032042.PAA06766@postman.osf.org>
(applied based on p5p patch as commit 316c7b3d7b47e3143f94c7f8621e854c519d1e87)
Subject: Fix lost value from READLINE after TIEHANDLE
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Files: pp_hot.c sv.h
TESTS
Subject: Create t/pragma directory; populate with new and old
From: Paul Marquess <pmarquess@bfsec.bt.co.uk>
Files: MANIFEST Makefile.SH t/TEST t/comp/use.t t/lib/locale.t t/op/overload.t t/op/use.t t/pragma/locale.t t/pragma/overload.t t/pragma/strict-refs t/pragma/strict-subs t/pragma/strict-vars t/pragma/strict.t t/pragma/subs.t t/pragma/warn-global t/pragma/warning.t
Subject: New tests: comp/colon.t and op/assignwarn.t
From: Robin Barker <rmb@cise.npl.co.uk>
Files: MANIFEST t/comp/colon.t t/op/assignwarn.t
Diffstat (limited to 'pod/buildtoc')
-rw-r--r-- | pod/buildtoc | 167 |
1 files changed, 98 insertions, 69 deletions
diff --git a/pod/buildtoc b/pod/buildtoc index daf26c1c57..30fa9ee69c 100644 --- a/pod/buildtoc +++ b/pod/buildtoc @@ -1,21 +1,23 @@ use File::Find; use Cwd; +use Text::Wrap; -@pods = qw{ - perl - perldata perlsyn perlop perlre perlrun perlfunc perlvar - perlsub perlmod perlform - perlref perldsc perllol perlobj perltie perlbot perlipc - perldebug perldiag perlsec perltrap perlstyle - perlpod perlbook +sub output ($); + +@pods = qw( + perl perlnews perldata perlsyn perlop perlre perlrun perlfunc + perlvar perlsub perlmod perlform perllocale perlref perldsc + perllol perltoot perlobj perltie perlbot perlipc perldebug + perldiag perlsec perltrap perlstyle perlpod perlbook perlembed perlapio perlxs perlxstut perlguts perlcall - }; -for (@pods) { s/$/.pod/ } + ); + +for (@pods) { s/$/.pod/ } $/ = ''; @ARGV = @pods; -($_= <<EOPOD2B) =~ s/^\t//gm && print; +($_= <<EOPOD2B) =~ s/^\t//gm && output($_); =head1 NAME @@ -23,38 +25,40 @@ $/ = ''; =head1 DESCRIPTION - This page provides a brief table of contents for the rest of the Perl - documentation set. It is meant to be be quickly scanned or grepped + This page provides a brief table of contents for the rest of the Perl + documentation set. It is meant to be bescanned quickly or grepped through to locate the proper section you're looking for. =head1 BASIC DOCUMENTATION EOPOD2B +#' make emacs happy podset(@pods); find \&getpods => qw(../lib ../ext); + sub getpods { - if (/\.p(od|m)$/) { - my $tmp; + if (/\.p(od|m)$/) { # Skip .pm files that have corresponding .pod files, and Functions.pm. - return if (($tmp = $_) =~ s/\.pm$/.pod/ && -f $tmp); - return if ($_ eq '../lib/Pod/Functions.pm');####Used only by pod itself - + return if /(.*)\.pm$/ && -f "$1.pod"; my $file = $File::Find::name; + return if $file eq '../lib/Pod/Functions.pm'; # Used only by pod itself + die "tut $name" if $file =~ /TUT/; unless (open (F, "< $_\0")) { warn "bogus <$file>: $!"; system "ls", "-l", $file; - } else { + } + else { my $line; while ($line = <F>) { if ($line =~ /^=head1\s+NAME\b/) { push @modpods, $file; #warn "GOOD $file\n"; return; - } - } + } + } warn "EVIL $file\n"; } } @@ -71,14 +75,14 @@ for (@modpods) { if ($done{$name}++) { # warn "already did $_\n"; next; - } + } push @modules, $_; push @modname, $name; - } -} + } +} + +($_= <<EOPOD2B) =~ s/^\t//gm && output($_); -($_= <<EOPOD2B) =~ s/^\t//gm && print; - =head1 PRAGMA DOCUMENTATION @@ -87,8 +91,8 @@ EOPOD2B podset(sort @pragmata); -($_= <<EOPOD2B) =~ s/^\t//gm && print; - +($_= <<EOPOD2B) =~ s/^\t//gm && output($_); + =head1 MODULE DOCUMENTATION @@ -98,41 +102,41 @@ EOPOD2B podset( @modules[ sort { $modname[$a] cmp $modname[$b] } 0 .. $#modules ] ); ($_= <<EOPOD2B) =~ s/^\t//gm; - + =head1 AUXILIARY DOCUMENTATION - Here should be listed all the extra programs' docs, but they - don't all have man pages yet: + Here should be listed all the extra programs' documentation, but they + don't all have manual pages yet: =item a2p =item s2p =item find2perl - + =item h2ph - + =item c2ph =item h2xs =item xsubpp - =item pod2man + =item pod2man =item wrapsuid =head1 AUTHOR - Larry Wall E<lt>F<larry\@wall.org>E<gt>, with the help of oodles + Larry Wall E<lt>F<larry\@wall.org>E<gt>, with the help of oodles of other folks. EOPOD2B -print; - +output $_; +output "\n"; # flush $LINE exit; sub podset { @@ -141,36 +145,30 @@ sub podset { while(<>) { if (s/^=head1 (NAME)\s*/=head2 /) { $pod = path2modname($ARGV); - sub path2modname { - local $_ = shift; - s/\.p(m|od)$//; - s-.*?/(lib|ext)/--; - s-/-::-g; - s/(\w+)::\1/$1/; - return $_; - } - unitem(); unhead2(); - print "\n \n\n=head2 "; + unitem(); + unhead2(); + output "\n \n\n=head2 "; $_ = <>; if ( /^\s*$pod\b/ ) { - print; + s/$pod\.pm/$pod/; # '.pm' in NAME !? + output $_; } else { s/^/$pod, /; - print; - } + output $_; + } next; } if (s/^=head1 (.*)/=item $1/) { unitem(); unhead2(); - print; nl(); next; - } + output $_; nl(); next; + } if (s/^=head2 (.*)/=item $1/) { unitem(); - print "=over\n\n" unless $inhead2; + output "=over\n\n" unless $inhead2; $inhead2 = 1; - print; nl(); next; + output $_; nl(); next; - } + } if (s/^=item (.*)\n/$1/) { next if $pod eq 'perldiag'; s/^\s*\*\s*$// && next; @@ -179,31 +177,62 @@ sub podset { next if /^[\d.]+$/; next if $pod eq 'perlmod' && /^ftp:/; ##print "=over\n\n" unless $initem; - print ", " if $initem; + output ", " if $initem; $initem = 1; s/\.$//; - print; next; - } - } + s/^-X\b/-I<X>/; + output $_; next; + } + } +} -} +sub path2modname { + local $_ = shift; + s/\.p(m|od)$//; + s-.*?/(lib|ext)/--; + s-/-::-g; + s/(\w+)::\1/$1/; + return $_; +} sub unhead2 { if ($inhead2) { - print "\n\n=back\n\n"; - } - $inhead2 = 0; - $initem = 0; -} + output "\n\n=back\n\n"; + } + $inhead2 = 0; + $initem = 0; +} sub unitem { if ($initem) { - print "\n\n"; + output "\n\n"; ##print "\n\n=back\n\n"; - } + } $initem = 0; -} +} sub nl { - print "\n"; -} + output "\n"; +} + +my $NEWLINE; # how many newlines have we seen recently +my $LINE; # what remains to be printed + +sub output ($) { + for (split /(\n)/, shift) { + if ($_ eq "\n") { + if ($LINE) { + print wrap('', '', $LINE); + $LINE = ''; + } + if ($NEWLINE < 2) { + print; + $NEWLINE++; + } + } + elsif (/\S/ && length) { + $LINE .= $_; + $NEWLINE = 0; + } + } +} |