# $Date: 1998/02/18 16:37:07 $
foreach $tocfile (@ARGV) {
warn qq/Warning: "$tocfile" is not writable\n/;
system("/bin/cp $tocfile $tocfile.$$");
open(IN
, "$tocfile.$$") or die "Unable to open $tocfile\n";
open(OUT
, ">$tocfile") or die "Unable to create $tocfile\n";
($id) = m
|name
="([^"]+)"|i;
$toctxt .= qq{<li><a href="#$id">$_</a></li>\n};
if (/<!--X-TOC-Start-->/) {
last if (/<!--X-TOC-End-->/);
print OUT
"<ul>\n", $toctxt, "</ul>\n",