3 $_= $ENV{'SCRIPT_FILENAME'};
7 print "Content-Type: text/plain\n\nERROR\n$_[0]\n" or die $!;
12 lstat $_ or fail("lstat $_ $!");
14 defined($rl= readlink) or fail("readlink $_ $!");
18 s,/[^/]+$,/$rl, or fail("linksub $_ ?");
21 s,/[^/]+$,/helpinfos, or die "$_ ?";
23 open HI, "< $_" or die $?;
26 ##$sf= $ENV{'SCRIPT_NAME'};
31 if (m/^\:([$tc]*)$/) {
34 } elsif (m/^\:\:(\w+)\s*(.*)$/) {
39 fail("notopic") unless defined $topic;
44 s#([^\\])\!\$([$tc]+)#
45 $1."<A href=\"$sf\">".$2."</A>";
49 $1."<A href=\"$sf/$2\">".$2."</A>";
53 $lines{$topic} .= "$_\n";
57 fail("intopic") if defined $topic;
59 close HI or fail("close hi $!");
61 foreach $topic (keys %xrefs) {
62 foreach $xr (keys %{ $xrefs{$topic} }) {
63 defined $lines{$xr} or fail("$topic -> $xr");
67 $topic= $ENV{'PATH_INFO'};
70 fail("unknown topic") unless $topic eq 'ALL' || defined $lines{$topic};
73 Content-Type: text/html
76 <title>$config{'wwwtitle'}
79 $o .= "- $topic" if length $topic;
85 if ($topic eq 'ALL') {
86 $o.= "<h1>All help topics in alphabetical order</h1>\n";
87 foreach $pt (sort keys %lines) {
91 $o.= "<h1>".ptitle($topic)." and its cross-references</h1>\n";
93 foreach $xr (sort keys %{ $xrefs{$topic} }) {
94 printout($xr) unless $xr eq $topic;
97 $o .= "See <A href=\"$sf\">top level</A>.\n";
99 $o .= "See <A href=\"$sf/ALL\">all topics</A>.\n<hr>\n"
102 $o.= "<address>$config{'wwwaddress'}</address>\n";
103 $o.= "</body></html>\n";
107 sub ptitle ($) { length $_[0] ? $_[0] : 'top level'; }
113 $rurl= length $pt ? "$sf/$pt" : $sf;
118 $o .= "<A href=\"$rurl\">$title</A>";
120 $o .= "</h2>\n<pre>\n";
122 $o .= "</pre>\n<hr>\n";