#!/usr/local/bin/perl
# view_perl.cgi
# View perl module documentation

require './man-lib.pl';
&ReadParse();

$in{'mod'} !~ /[\\\&\;\`\'\"\|\*\?\~\<\>\^\(\)\[\]\{\}\$\n\r]/ ||
	&error($text{'perl_emod'});

&header($text{'perl_title'}, "");
print "<hr>\n";

print "<table border width=100%>\n";
print "<tr $tb> <td><b>",&text('perl_header', $in{'mod'}),"</b></td> </tr>\n";
print "<tr $cb> <td><pre>";
@for = split(/\s+/, $in{'for'});
open(DOC, "$perl_doc -t $in{'mod'} |");
while($line = <DOC>) {
	$line = &html_escape($line);
	foreach $f (@for) {
		$line =~ s/($f)/<b>$1<\/b>/ig;
		}
	print $line;
	}
close(DOC);
print "</pre></td></tr></table><p>\n";

print "<hr>\n";
&footer("", $text{'index_return'});

