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'};
30 if (m/^\:([$tc]*)$/) {
33 } elsif (m/^\:\:(\w+)\s*(.*)$/) {
38 fail("notopic") unless defined $topic;
43 s#([^\\])\!\$([$tc]+)#
44 $1."<A href=\"$sf\">".$2."</A>";
48 $1."<A href=\"$sf/$2\">".$2."</A>";
52 $lines{$topic} .= "$_\n";
56 fail("intopic") if defined $topic;
58 close HI or fail("close hi $!");
60 foreach $topic (keys %xrefs) {
61 foreach $xr (keys %{ $xrefs{$topic} }) {
62 defined $lines{$xr} or fail("$topic -> $xr");
66 $topic= $ENV{'PATH_INFO'};
69 fail("unknown topic") unless $topic eq 'ALL' || defined $lines{$topic};
72 Content-Type: text/html
75 <title>$config{'wwwtitle'}
78 $o .= "- $topic" if length $topic;
84 if ($topic eq 'ALL') {
85 $o.= "<h1>All help topics in alphabetical order</h1>\n";
86 foreach $pt (sort keys %lines) {
90 $o.= "<h1>".ptitle($topic)." and its cross-references</h1>\n";
92 foreach $xr (sort keys %{ $xrefs{$topic} }) {
93 printout($xr) unless $xr eq $topic;
96 $o .= "See <A href=\"$sf\">top level</A>.\n";
98 $o .= "See <A href=\"$sf/ALL\">all topics</A>.\n<hr>\n"
101 $o.= "<address>$config{'wwwaddress'}</address>\n";
102 $o.= "</body></html>\n";
106 sub ptitle ($) { length $_[0] ? $_[0] : 'top level'; }
112 $rurl= length $pt ? "$sf/$pt" : $sf;
117 $o .= "<A href=\"$rurl\">$title</A>";
119 $o .= "</h2>\n<pre>\n";
121 $o .= "</pre>\n<hr>\n";