#!/usr/local/bin/perl
#Opens the current file and dsisplays its contents to the screen
#file: test_file.pl

$filename="test_file.pl";

print "Content-type: text/html\n\n";

print <<END;
<html>
<head>
<title>Display the contents of the current script</title>
</head>
<body>
Here are the contents of this script
<hr size=6>
<table border=0 bgcolor=#ffffff>
<tr>
<td>
<pre>
END
open (file,$filename);
while (<file>)
{
    $encoded = encode($_);
    print "$encoded";
}
print <<END;
</table>
</pre>
<hr size=6>
</body>
</html>
END
    ;
sub encode
{
    s/&/&amp;/g;
    s/</&lt;/g;
    s/>/&gt;/g;
    return $_;
}





