make PPPort/harness build on VMS
[p5sagit/p5-mst-13.2.git] / lib / Pod / Html.pm
index 6995361..9586f8e 100644 (file)
@@ -10,6 +10,7 @@ $VERSION = 1.04;
 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,8 +309,7 @@ $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
@@ -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"