}
close FILE;
- my $outfile = ".$infile.toc";
+ my $outfile = "$infile.toc";
+ $outfile =~ s|\./||g;
$outfile =~ s|\.\./||g;
$outfile =~ s|/|_|g;
- open OUTPUT,"> $outfile";
+ $outfile = ".$outfile";
+ print "Create a TOC for $infile (in $outfile)\n";
+ open OUTPUT,"> ./$outfile";
my($current_level)=-1;
my($entry);
print OUTPUT "<!-- Automatically generated table of contents --!>\n";
}
print OUTPUT "</div>\n";
print OUTPUT "<!-- End of automatically generated table of contents --!>\n";
+ close OUTPUT;
} # sub handle_file
-map { handle_file($_) } @ARGV;
\ No newline at end of file
+map { handle_file($_) } @ARGV;