make PPPort/harness build on VMS
[p5sagit/p5-mst-13.2.git] / lib / Pod / Html.pm
index 7a85f5c..9586f8e 100644 (file)
@@ -3,13 +3,14 @@ use strict;
 require Exporter;
 
 use vars qw($VERSION @ISA @EXPORT);
-$VERSION = 1.03;
+$VERSION = 1.04;
 @ISA = qw(Exporter);
 @EXPORT = qw(pod2html htmlify);
 
 use Carp;
 use Config;
 use Cwd;
+use File::Spec;
 use File::Spec::Unix;
 use Getopt::Long;
 
@@ -220,7 +221,7 @@ my $htmlfileurl = "" ;              # The url that other files would use to
                                # other files.
 my $podfile = "";              # read from stdin by default
 my @podpath = ();              # list of directories containing library pods.
-my $podroot = ".";             # filesystem base directory from which all
+my $podroot = File::Spec->curdir;              # filesystem base directory from which all
                                #   relative paths in $podpath stem.
 my $css = '';                   # Cascading style sheet
 my $recurse = 1;               # recurse on subdirectories in $podpath.
@@ -267,7 +268,7 @@ $htmldir = "";              # The directory to which the html pages
 $htmlfile = "";                # write to stdout by default
 $podfile = "";         # read from stdin by default
 @podpath = ();         # list of directories containing library pods.
-$podroot = ".";                # filesystem base directory from which all
+$podroot = File::Spec->curdir;         # filesystem base directory from which all
                                #   relative paths in $podpath stem.
 $css = '';                   # Cascading style sheet
 $recurse = 1;          # recurse on subdirectories in $podpath.
@@ -308,12 +309,11 @@ $Is83=$^O eq 'dos';
 #
 sub clean_data($){
     my( $dataref ) = @_;
-    my $i;
-    for( $i = 0; $i <= $#$dataref; $i++ ){
+    for my $i ( 0..$#{$dataref} ) {
        ${$dataref}[$i] =~ s/\s+\Z//;
 
         # have a look for all-space lines
-       if( ${$dataref}[$i] =~ /^\s+$/m ){
+      if( ${$dataref}[$i] =~ /^\s+$/m and $dataref->[$i] !~ /^\s/ ){
            my @chunks = split( /^\s+$/m, ${$dataref}[$i] );
            splice( @$dataref, $i, 1, @chunks );
        }
@@ -384,7 +384,7 @@ sub pod2html {
     # put a title in the HTML file if one wasn't specified
     if ($title eq '') {
        TITLE_SEARCH: {
-           for (my $i = 0; $i < @poddata; $i++) { 
+           for my $i ( 0..$#poddata ) {
                if ($poddata[$i] =~ /^=head1\s*NAME\b/m) {
                    for my $para ( @poddata[$i, $i+1] ) { 
                        last TITLE_SEARCH
@@ -397,7 +397,7 @@ sub pod2html {
     }
     if (!$title and $podfile =~ /\.pod\z/) {
        # probably a split pod so take first =head[12] as title
-       for (my $i = 0; $i < @poddata; $i++) { 
+       for my $i ( 0..$#poddata ) {
            last if ($title) = $poddata[$i] =~ /^=head[12]\s*(.*)/;
        } 
        warn "adopted '$title' as title for $podfile\n"
@@ -427,7 +427,6 @@ END_OF_BLOCK
 <HTML>
 <HEAD>
 <TITLE>$title</TITLE>$csslink
-<LINK REV="made" HREF="mailto:$Config{perladmin}">
 </HEAD>
 
 <BODY>
@@ -1170,7 +1169,7 @@ sub process_cut {
 }
 
 #
-# process_pod - process a pod pod tag, thus stop ignoring pod directives
+# process_pod - process a pod tag, thus stop ignoring pod directives
 # until we see a corresponding cut.
 #
 sub process_pod {
@@ -1575,7 +1574,7 @@ sub process_text1($$;$$){
             warn "$0: $podfile: cannot resolve L<$opar> in paragraph $paragraph.";
         }
 
-        # now we have an URL or just plain code
+        # now we have a URL or just plain code
         $$rstr = $linktext . '>' . $$rstr;
         if( defined( $url ) ){
             $res = "<A HREF=\"$url\">" . process_text1( $lev, $rstr ) . '</A>';
@@ -1693,7 +1692,7 @@ sub dosify {
 }
 
 #
-# page_sect - make an URL from the text of a L<>
+# page_sect - make a URL from the text of a L<>
 #
 sub page_sect($$) {
     my( $page, $section ) = @_;