From: Michael G. Schwern
Date: Mon, 18 Aug 2003 03:29:09 +0000 (-0700)
Subject: Uppercase globals in Pod::Html
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=69348ecf33f75afaac226389e2d846abbe0d28e2;p=p5sagit%2Fp5-mst-13.2.git
Uppercase globals in Pod::Html
Message-ID: <20030818102909.GJ823@windhund.schwern.org>
p4raw-id: //depot/perl@20758
---
diff --git a/lib/Pod/Html.pm b/lib/Pod/Html.pm
index 77964ee..c4af19c 100644
--- a/lib/Pod/Html.pm
+++ b/lib/Pod/Html.pm
@@ -203,95 +203,95 @@ This program is distributed under the Artistic License.
=cut
-my($cachedir);
-my($dircache, $itemcache);
-my @begin_stack;
-my @libpods;
-my($htmlroot, $htmldir, $htmlfile, $htmlfileurl);
-my($podfile, @podpath, $podroot);
-my $css;
+my($Cachedir);
+my($Dircache, $Itemcache);
+my @Begin_Stack;
+my @Libpods;
+my($Htmlroot, $Htmldir, $Htmlfile, $Htmlfileurl);
+my($Podfile, @Podpath, $Podroot);
+my $Css;
-my $recurse;
-my $quiet;
-my $verbose;
-my $doindex;
+my $Recurse;
+my $Quiet;
+my $Verbose;
+my $Doindex;
-my $backlink;
-my($listlevel, @listend);
-my $after_lpar;
-my $ignore;
+my $Backlink;
+my($Listlevel, @Listend);
+my $After_Lpar;
+use vars qw($Ignore); # need to localize it later.
-my(%items_named, @items_seen);
-my($title, $header);
+my(%Items_Named, @Items_Seen);
+my($Title, $Header);
-my $top;
-my $paragraph;
+my $Top;
+my $Paragraph;
-my %sections;
+my %Sections;
# Caches
-my %pages = (); # associative array used to find the location
+my %Pages = (); # associative array used to find the location
# of pages referenced by L<> links.
-my %items = (); # associative array used to find the location
+my %Items = (); # associative array used to find the location
# of =item directives referenced by C<> links
-my %local_items;
+my %Local_Items;
my $Is83;
-my $ptQuote;
+my $PTQuote;
my $Curdir = File::Spec->curdir;
init_globals();
sub init_globals {
- $cachedir = "."; # The directory to which item and directory
+ $Cachedir = "."; # The directory to which item and directory
# caches will be written.
- $dircache = "pod2htmd.tmp";
- $itemcache = "pod2htmi.tmp";
+ $Dircache = "pod2htmd.tmp";
+ $Itemcache = "pod2htmi.tmp";
- @begin_stack = (); # begin/end stack
+ @Begin_Stack = (); # begin/end stack
- @libpods = (); # files to search for links from C<> directives
- $htmlroot = "/"; # http-server base directory from which all
+ @Libpods = (); # files to search for links from C<> directives
+ $Htmlroot = "/"; # http-server base directory from which all
# relative paths in $podpath stem.
- $htmldir = ""; # The directory to which the html pages
+ $Htmldir = ""; # The directory to which the html pages
# will (eventually) be written.
- $htmlfile = ""; # write to stdout by default
- $htmlfileurl = "" ; # The url that other files would use to
+ $Htmlfile = ""; # write to stdout by default
+ $Htmlfileurl = "" ; # The url that other files would use to
# refer to this file. This is only used
# to make relative urls that point to
# other files.
- $podfile = ""; # read from stdin by default
- @podpath = (); # list of directories containing library pods.
- $podroot = $Curdir; # filesystem base directory from which all
+ $Podfile = ""; # read from stdin by default
+ @Podpath = (); # list of directories containing library pods.
+ $Podroot = $Curdir; # filesystem base directory from which all
# relative paths in $podpath stem.
- $css = ''; # Cascading style sheet
- $recurse = 1; # recurse on subdirectories in $podpath.
- $quiet = 0; # not quiet by default
- $verbose = 0; # not verbose by default
- $doindex = 1; # non-zero if we should generate an index
- $backlink = ''; # text for "back to top" links
- $listlevel = 0; # current list depth
- @listend = (); # the text to use to end the list.
- $after_lpar = 0; # set to true after a par in an =item
- $ignore = 1; # whether or not to format text. we don't
+ $Css = ''; # Cascading style sheet
+ $Recurse = 1; # recurse on subdirectories in $podpath.
+ $Quiet = 0; # not quiet by default
+ $Verbose = 0; # not verbose by default
+ $Doindex = 1; # non-zero if we should generate an index
+ $Backlink = ''; # text for "back to top" links
+ $Listlevel = 0; # current list depth
+ @Listend = (); # the text to use to end the list.
+ $After_Lpar = 0; # set to true after a par in an =item
+ $Ignore = 1; # whether or not to format text. we don't
# format text until we hit our first pod
# directive.
- @items_seen = (); # for multiples of the same item in perlfunc
- %items_named = ();
- $header = 0; # produce block header/footer
- $title = ''; # title to give the pod(s)
- $top = 1; # true if we are at the top of the doc. used
+ @Items_Seen = (); # for multiples of the same item in perlfunc
+ %Items_Named = ();
+ $Header = 0; # produce block header/footer
+ $Title = ''; # title to give the pod(s)
+ $Top = 1; # true if we are at the top of the doc. used
# to prevent the first directive.
- $paragraph = ''; # which paragraph we're processing (used
+ $Paragraph = ''; # which paragraph we're processing (used
# for error messages)
- $ptQuote = 0; # status of double-quote conversion
- %sections = (); # sections within this page
+ $PTQuote = 0; # status of double-quote conversion
+ %Sections = (); # sections within this page
- %local_items = ();
+ %Local_Items = ();
$Is83 = $^O eq 'dos'; # Is it an 8.3 filesystem?
}
@@ -321,7 +321,7 @@ sub pod2html {
$Is83 = 0 if (defined (&Dos::UseLFN) && Dos::UseLFN());
- # cache of %pages and %items from last time we ran pod2html
+ # cache of %Pages and %Items from last time we ran pod2html
#undef $opt_help if defined $opt_help;
@@ -329,36 +329,36 @@ sub pod2html {
parse_command_line();
# escape the backlink argument (same goes for title but is done later...)
- $backlink = html_escape($backlink) if defined $backlink;
+ $Backlink = html_escape($Backlink) if defined $Backlink;
# set some variables to their default values if necessary
local *POD;
unless (@ARGV && $ARGV[0]) {
- $podfile = "-" unless $podfile; # stdin
- open(POD, "<$podfile")
- || die "$0: cannot open $podfile file for input: $!\n";
+ $Podfile = "-" unless $Podfile; # stdin
+ open(POD, "<$Podfile")
+ || die "$0: cannot open $Podfile file for input: $!\n";
} else {
- $podfile = $ARGV[0]; # XXX: might be more filenames
+ $Podfile = $ARGV[0]; # XXX: might be more filenames
*POD = *ARGV;
}
- $htmlfile = "-" unless $htmlfile; # stdout
- $htmlroot = "" if $htmlroot eq "/"; # so we don't get a //
- $htmldir =~ s#/\z## ; # so we don't get a //
- if ( $htmlroot eq ''
- && defined( $htmldir )
- && $htmldir ne ''
- && substr( $htmlfile, 0, length( $htmldir ) ) eq $htmldir
+ $Htmlfile = "-" unless $Htmlfile; # stdout
+ $Htmlroot = "" if $Htmlroot eq "/"; # so we don't get a //
+ $Htmldir =~ s#/\z## ; # so we don't get a //
+ if ( $Htmlroot eq ''
+ && defined( $Htmldir )
+ && $Htmldir ne ''
+ && substr( $Htmlfile, 0, length( $Htmldir ) ) eq $Htmldir
)
{
# Set the 'base' url for this file, so that we can use it
# as the location from which to calculate relative links
# to other files. If this is '', then absolute links will
# be used throughout.
- $htmlfileurl= "$htmldir/" . substr( $htmlfile, length( $htmldir ) + 1);
+ $Htmlfileurl= "$Htmldir/" . substr( $Htmlfile, length( $Htmldir ) + 1);
}
# read the pod a paragraph at a time
- warn "Scanning for sections in input file(s)\n" if $verbose;
+ warn "Scanning for sections in input file(s)\n" if $Verbose;
$/ = "";
my @poddata = ;
close(POD);
@@ -384,64 +384,64 @@ sub pod2html {
clean_data( \@poddata );
# scan the pod for =head[1-6] directives and build an index
- my $index = scan_headings(\%sections, @poddata);
+ my $index = scan_headings(\%Sections, @poddata);
unless($index) {
- warn "No headings in $podfile\n" if $verbose;
+ warn "No headings in $Podfile\n" if $Verbose;
}
# open the output file
- open(HTML, ">$htmlfile")
- || die "$0: cannot open $htmlfile file for output: $!\n";
+ open(HTML, ">$Htmlfile")
+ || die "$0: cannot open $Htmlfile file for output: $!\n";
# put a title in the HTML file if one wasn't specified
- if ($title eq '') {
+ if ($Title eq '') {
TITLE_SEARCH: {
for (my $i = 0; $i < @poddata; $i++) {
if ($poddata[$i] =~ /^=head1\s*NAME\b/m) {
for my $para ( @poddata[$i, $i+1] ) {
last TITLE_SEARCH
- if ($title) = $para =~ /(\S+\s+-+.*\S)/s;
+ if ($Title) = $para =~ /(\S+\s+-+.*\S)/s;
}
}
}
}
}
- if (!$title and $podfile =~ /\.pod\z/) {
+ if (!$Title and $Podfile =~ /\.pod\z/) {
# probably a split pod so take first =head[12] as title
for (my $i = 0; $i < @poddata; $i++) {
- last if ($title) = $poddata[$i] =~ /^=head[12]\s*(.*)/;
+ last if ($Title) = $poddata[$i] =~ /^=head[12]\s*(.*)/;
}
- warn "adopted '$title' as title for $podfile\n"
- if $verbose and $title;
+ warn "adopted '$Title' as title for $Podfile\n"
+ if $Verbose and $Title;
}
- if ($title) {
- $title =~ s/\s*\(.*\)//;
+ if ($Title) {
+ $Title =~ s/\s*\(.*\)//;
} else {
- warn "$0: no title for $podfile.\n" unless $quiet;
- $podfile =~ /^(.*)(\.[^.\/]+)?\z/s;
- $title = ($podfile eq "-" ? 'No Title' : $1);
- warn "using $title" if $verbose;
+ warn "$0: no title for $Podfile.\n" unless $Quiet;
+ $Podfile =~ /^(.*)(\.[^.\/]+)?\z/s;
+ $Title = ($Podfile eq "-" ? 'No Title' : $1);
+ warn "using $Title" if $Verbose;
}
- $title = html_escape($title);
+ $Title = html_escape($Title);
my $csslink = '';
my $bodystyle = ' style="background-color: white"';
my $tdstyle = ' style="background-color: #cccccc"';
- if ($css) {
- $csslink = qq(\n);
+ if ($Css) {
+ $csslink = qq(\n);
$csslink =~ s,\\,/,g;
$csslink =~ s,(/.):,$1|,;
$bodystyle = '';
$tdstyle = '';
}
- my $block = $header ? <
- $title
+ $Title
END_OF_BLOCK
@@ -450,7 +450,7 @@ END_OF_BLOCK
-$title$csslink
+$Title$csslink
@@ -458,35 +458,35 @@ END_OF_BLOCK
$block
END_OF_HEAD
- # load/reload/validate/cache %pages and %items
- get_cache($dircache, $itemcache, \@podpath, $podroot, $recurse);
+ # load/reload/validate/cache %Pages and %Items
+ get_cache($Dircache, $Itemcache, \@Podpath, $Podroot, $Recurse);
# scan the pod for =item directives
- scan_items( \%local_items, "", @poddata);
+ scan_items( \%Local_Items, "", @poddata);
- # put an index at the top of the file. note, if $doindex is 0 we
+ # put an index at the top of the file. note, if $Doindex is 0 we
# still generate an index, but surround it with an html comment.
# that way some other program can extract it if desired.
$index =~ s/--+/-/g;
print HTML "
\n";
print HTML "\n";
- print HTML "\n" unless $doindex;
+ print HTML "-->\n" unless $Doindex;
print HTML "\n\n";
- print HTML "\n" if $doindex and $index;
+ print HTML "\n" if $Doindex and $index;
# now convert this file
my $after_item; # set to true after an =item
my $need_dd = 0;
- warn "Converting input file $podfile\n" if $verbose;
+ warn "Converting input file $Podfile\n" if $Verbose;
foreach my $i (0..$#poddata){
- $ptQuote = 0; # status of quote conversion
+ $PTQuote = 0; # status of quote conversion
$_ = $poddata[$i];
- $paragraph = $i+1;
+ $Paragraph = $i+1;
if (/^(=.*)/s) { # is it a pod directive?
- $ignore = 0;
+ $Ignore = 0;
$after_item = 0;
$need_dd = 0;
$_ = $1;
@@ -499,10 +499,10 @@ END_OF_HEAD
} elsif (/^=pod/) { # =pod
process_pod();
} else {
- next if @begin_stack && $begin_stack[-1] ne 'html';
+ next if @Begin_Stack && $Begin_Stack[-1] ne 'html';
if (/^=(head[1-6])\s+(.*\S)/s) { # =head[1-6] heading
- process_head( $1, $2, $doindex && $index );
+ process_head( $1, $2, $Doindex && $index );
} elsif (/^=item\s*(.*\S)?/sm) { # =item text
$need_dd = process_item( $1 );
$after_item = 1;
@@ -514,16 +514,16 @@ END_OF_HEAD
process_for($1,$2);
} else {
/^=(\S*)\s*/;
- warn "$0: $podfile: unknown pod directive '$1' in "
- . "paragraph $paragraph. ignoring.\n";
+ warn "$0: $Podfile: unknown pod directive '$1' in "
+ . "paragraph $Paragraph. ignoring.\n";
}
}
- $top = 0;
+ $Top = 0;
}
else {
- next if $ignore;
- next if @begin_stack && $begin_stack[-1] ne 'html';
- print HTML and next if @begin_stack && $begin_stack[-1] eq 'html';
+ next if $Ignore;
+ next if @Begin_Stack && $Begin_Stack[-1] ne 'html';
+ print HTML and next if @Begin_Stack && $Begin_Stack[-1] eq 'html';
print HTML "
\n" if $need_dd;
my $text = $_;
if( $text =~ /\A\s+/ ){
@@ -557,7 +557,7 @@ END_OF_HEAD
if( $after_item ){
print HTML "$text\n";
- $after_lpar = 1;
+ $After_Lpar = 1;
} else {
print HTML "
$text
\n";
}
@@ -571,8 +571,8 @@ END_OF_HEAD
finish_list();
# link to page index
- print HTML "
\n"
+ if $Doindex and $index and $Backlink;
print HTML < --infile= --outfile=
--podpath=:...: --podroot=
--libpods=:...: --recurse --verbose --index
@@ -634,6 +630,8 @@ Usage: $0 --help --htmlroot= --infile= --outfile=
END_OF_USAGE
+}
+
sub parse_command_line {
my ($opt_backlink,$opt_cachedir,$opt_css,$opt_flush,$opt_header,$opt_help,
$opt_htmldir,$opt_htmlroot,$opt_index,$opt_infile,$opt_libpods,
@@ -667,35 +665,35 @@ sub parse_command_line {
usage("-") if defined $opt_help; # see if the user asked for help
$opt_help = ""; # just to make -w shut-up.
- @podpath = split(":", $opt_podpath) if defined $opt_podpath;
- @libpods = split(":", $opt_libpods) if defined $opt_libpods;
-
- $backlink = $opt_backlink if defined $opt_backlink;
- $cachedir = $opt_cachedir if defined $opt_cachedir;
- $css = $opt_css if defined $opt_css;
- $header = $opt_header if defined $opt_header;
- $htmldir = $opt_htmldir if defined $opt_htmldir;
- $htmlroot = $opt_htmlroot if defined $opt_htmlroot;
- $doindex = $opt_index if defined $opt_index;
- $podfile = $opt_infile if defined $opt_infile;
- $htmlfile = $opt_outfile if defined $opt_outfile;
- $podroot = $opt_podroot if defined $opt_podroot;
- $quiet = $opt_quiet if defined $opt_quiet;
- $recurse = $opt_recurse if defined $opt_recurse;
- $title = $opt_title if defined $opt_title;
- $verbose = $opt_verbose if defined $opt_verbose;
+ @Podpath = split(":", $opt_podpath) if defined $opt_podpath;
+ @Libpods = split(":", $opt_libpods) if defined $opt_libpods;
+
+ $Backlink = $opt_backlink if defined $opt_backlink;
+ $Cachedir = $opt_cachedir if defined $opt_cachedir;
+ $Css = $opt_css if defined $opt_css;
+ $Header = $opt_header if defined $opt_header;
+ $Htmldir = $opt_htmldir if defined $opt_htmldir;
+ $Htmlroot = $opt_htmlroot if defined $opt_htmlroot;
+ $Doindex = $opt_index if defined $opt_index;
+ $Podfile = $opt_infile if defined $opt_infile;
+ $Htmlfile = $opt_outfile if defined $opt_outfile;
+ $Podroot = $opt_podroot if defined $opt_podroot;
+ $Quiet = $opt_quiet if defined $opt_quiet;
+ $Recurse = $opt_recurse if defined $opt_recurse;
+ $Title = $opt_title if defined $opt_title;
+ $Verbose = $opt_verbose if defined $opt_verbose;
warn "Flushing item and directory caches\n"
if $opt_verbose && defined $opt_flush;
- $dircache = "$cachedir/pod2htmd.tmp";
- $itemcache = "$cachedir/pod2htmi.tmp";
+ $Dircache = "$Cachedir/pod2htmd.tmp";
+ $Itemcache = "$Cachedir/pod2htmi.tmp";
if (defined $opt_flush) {
- 1 while unlink($dircache, $itemcache);
+ 1 while unlink($Dircache, $Itemcache);
}
}
-my $saved_cache_key;
+my $Saved_Cache_Key;
sub get_cache {
my($dircache, $itemcache, $podpath, $podroot, $recurse) = @_;
@@ -707,23 +705,23 @@ sub get_cache {
my $this_cache_key = cache_key(@cache_key_args);
- return if $saved_cache_key and $this_cache_key eq $saved_cache_key;
+ return if $Saved_Cache_Key and $this_cache_key eq $Saved_Cache_Key;
- # load the cache of %pages and %items if possible. $tests will be
+ # load the cache of %Pages and %Items if possible. $tests will be
# non-zero if successful.
my $tests = 0;
if (-f $dircache && -f $itemcache) {
- warn "scanning for item cache\n" if $verbose;
+ warn "scanning for item cache\n" if $Verbose;
$tests = load_cache($dircache, $itemcache, $podpath, $podroot);
}
# if we didn't succeed in loading the cache then we must (re)build
- # %pages and %items.
+ # %Pages and %Items.
if (!$tests) {
- warn "scanning directories in pod-path\n" if $verbose;
+ warn "scanning directories in pod-path\n" if $Verbose;
scan_podpath($podroot, $recurse, 0);
}
- $saved_cache_key = cache_key(@cache_key_args);
+ $Saved_Cache_Key = cache_key(@cache_key_args);
}
sub cache_key {
@@ -734,7 +732,7 @@ sub cache_key {
#
# load_cache - tries to find if the caches stored in $dircache and $itemcache
-# are valid caches of %pages and %items. if they are valid then it loads
+# are valid caches of %Pages and %Items. if they are valid then it loads
# them and returns a non-zero value.
#
sub load_cache {
@@ -764,14 +762,14 @@ sub load_cache {
return 0;
}
- warn "loading item cache\n" if $verbose;
+ warn "loading item cache\n" if $Verbose;
while () {
/(.*?) (.*)$/;
- $items{$1} = $2;
+ $Items{$1} = $2;
}
close(CACHE);
- warn "scanning for directory cache\n" if $verbose;
+ warn "scanning for directory cache\n" if $Verbose;
open(CACHE, "<$dircache") ||
die "$0: error opening $dircache for reading: $!\n";
$/ = "\n";
@@ -793,10 +791,10 @@ sub load_cache {
return 0;
}
- warn "loading directory cache\n" if $verbose;
+ warn "loading directory cache\n" if $Verbose;
while () {
/(.*?) (.*)$/;
- $pages{$1} = $2;
+ $Pages{$1} = $2;
}
close(CACHE);
@@ -807,7 +805,7 @@ sub load_cache {
#
# scan_podpath - scans the directories specified in @podpath for directories,
# .pod files, and .pm files. it also scans the pod files specified in
-# @libpods for =item directives.
+# @Libpods for =item directives.
#
sub scan_podpath {
my($podroot, $recurse, $append) = @_;
@@ -815,28 +813,28 @@ sub scan_podpath {
my($libpod, $dirname, $pod, @files, @poddata);
unless($append) {
- %items = ();
- %pages = ();
+ %Items = ();
+ %Pages = ();
}
- # scan each directory listed in @podpath
+ # scan each directory listed in @Podpath
$pwd = getcwd();
chdir($podroot)
|| die "$0: error changing to directory $podroot: $!\n";
- foreach $dir (@podpath) {
+ foreach $dir (@Podpath) {
scan_dir($dir, $recurse);
}
- # scan the pods listed in @libpods for =item directives
- foreach $libpod (@libpods) {
+ # scan the pods listed in @Libpods for =item directives
+ foreach $libpod (@Libpods) {
# if the page isn't defined then we won't know where to find it
# on the system.
- next unless defined $pages{$libpod} && $pages{$libpod};
+ next unless defined $Pages{$libpod} && $Pages{$libpod};
# if there is a directory then use the .pod and .pm files within it.
# NOTE: Only finds the first so-named directory in the tree.
-# if ($pages{$libpod} =~ /([^:]*[^(\.pod|\.pm)]):/) {
- if ($pages{$libpod} =~ /([^:]*(?$itemcache") ||
- die "$0: error open $itemcache for writing: $!\n";
+ warn "caching items for later use\n" if $Verbose;
+ open(CACHE, ">$Itemcache") ||
+ die "$0: error open $Itemcache for writing: $!\n";
- print CACHE join(":", @podpath) . "\n$podroot\n";
- foreach my $key (keys %items) {
- print CACHE "$key $items{$key}\n";
+ print CACHE join(":", @Podpath) . "\n$podroot\n";
+ foreach my $key (keys %Items) {
+ print CACHE "$key $Items{$key}\n";
}
close(CACHE);
# cache the directory list for later use
- warn "caching directories for later use\n" if $verbose;
- open(CACHE, ">$dircache") ||
- die "$0: error open $dircache for writing: $!\n";
+ warn "caching directories for later use\n" if $Verbose;
+ open(CACHE, ">$Dircache") ||
+ die "$0: error open $Dircache for writing: $!\n";
- print CACHE join(":", @podpath) . "\n$podroot\n";
- foreach my $key (keys %pages) {
- print CACHE "$key $pages{$key}\n";
+ print CACHE join(":", @Podpath) . "\n$podroot\n";
+ foreach my $key (keys %Pages) {
+ print CACHE "$key $Pages{$key}\n";
}
close(CACHE);
@@ -924,22 +922,22 @@ sub scan_dir {
die "$0: error opening directory $dir: $!\n";
while (defined($_ = readdir(DIR))) {
if (-d "$dir/$_" && $_ ne "." && $_ ne "..") { # directory
- $pages{$_} = "" unless defined $pages{$_};
- $pages{$_} .= "$dir/$_:";
+ $Pages{$_} = "" unless defined $Pages{$_};
+ $Pages{$_} .= "$dir/$_:";
push(@subdirs, $_);
} elsif (/\.pod\z/) { # .pod
s/\.pod\z//;
- $pages{$_} = "" unless defined $pages{$_};
- $pages{$_} .= "$dir/$_.pod:";
+ $Pages{$_} = "" unless defined $Pages{$_};
+ $Pages{$_} .= "$dir/$_.pod:";
push(@pods, "$dir/$_.pod");
} elsif (/\.html\z/) { # .html
s/\.html\z//;
- $pages{$_} = "" unless defined $pages{$_};
- $pages{$_} .= "$dir/$_.pod:";
+ $Pages{$_} = "" unless defined $Pages{$_};
+ $Pages{$_} .= "$dir/$_.pod:";
} elsif (/\.pm\z/) { # .pm
s/\.pm\z//;
- $pages{$_} = "" unless defined $pages{$_};
- $pages{$_} .= "$dir/$_.pm:";
+ $Pages{$_} = "" unless defined $Pages{$_};
+ $Pages{$_} .= "$dir/$_.pm:";
push(@pods, "$dir/$_.pm");
}
}
@@ -961,9 +959,7 @@ sub scan_headings {
my($sections, @data) = @_;
my($tag, $which_head, $otitle, $listdepth, $index);
- # here we need local $ignore = 0;
- # unfortunately, we can't have it, because $ignore is lexical
- $ignore = 0;
+ local $Ignore = 0;
$listdepth = 0;
$index = "";
@@ -1003,8 +999,6 @@ sub scan_headings {
# get rid of bogus lists
$index =~ s,\t*
\s*
\n,,g;
- $ignore = 1; # restore old value;
-
return $index;
}
@@ -1050,17 +1044,17 @@ sub process_head {
$tag =~ /head([1-6])/;
my $level = $1;
- if( $listlevel ){
- warn "$0: $podfile: unterminated list at =head in paragraph $paragraph. ignoring.\n";
- while( $listlevel ){
+ if( $Listlevel ){
+ warn "$0: $Podfile: unterminated list at =head in paragraph $Paragraph. ignoring.\n";
+ while( $Listlevel ){
process_back();
}
}
print HTML "
\n";
- if( $level == 1 && ! $top ){
- print HTML "$backlink\n"
- if $hasindex and $backlink;
+ if( $level == 1 && ! $Top ){
+ print HTML "$Backlink\n"
+ if $hasindex and $Backlink;
print HTML "