--- /dev/null
+#!/usr/bin/perl -w
+
+#------------------------------------------------------------
+# docs.cgi
+#
+# Web-based text file viewer.
+# Copyright Paul Mutton, 2000.
+#------------------------------------------------------------
+
+use strict;
+use CGI;
+
+$| = 1;
+
+# Settings
+my ($left) = "../left.inc" ;
+my ($title) = "../title.inc";
+my ($bottom) = "../bottom.inc";
+
+
+my ($query) = new CGI;
+my ($doci) = ($query->param('doc') =~ /^\s*(.*?\.txt)\s*$/);
+my ($doc) = "../documentation/$doci";
+
+print "content-type: text/html\n\n";
+
+print <<"END";
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<!--
+ docs.cgi
+ Web-based text file viewer and formatter.
+ Created by pjm2 19/10/2000
+ Last modified 19/10/2000
+-->
+
+<html>
+
+<head>
+ <title>The i-scream Project Documentation Viewer</title>
+ <meta name="description" content="The i-scream Project is a central monitoring system for Unix, Linux and NT servers.">
+ <meta name="keywords" content="i-scream, project, central monitoring system, unix, linux, nt, server, alert">
+ <meta name="generator" content="notepad on acid, aye.">
+</head>
+
+<body bgcolor="#ffffff" link="#0000ff" alink="#3333cc" vlink="#3333cc" text="#000066">
+
+<table border="0" cellpadding="2" cellspacing="2">
+ <tr>
+ <td valign="top">
+END
+
+&print_file($left);
+
+print <<"END";
+
+ </td>
+ <td valign="top">
+END
+
+&print_file($title);
+
+print "<PRE>\n";
+&print_file($doc);
+print "</PRE>\n";
+
+&print_file($bottom);
+
+print <<"END";
+
+ </td>
+ </tr>
+</table>
+
+</body>
+
+</html>
+END
+
+exit 0;
+
+sub print_file ($) {
+ my ($filename) = @_;
+ print `cat $filename`;
+}
+
+sub print_file_old ($) {
+ my ($filename) = @_;
+ open(FILE, $filename) or die "Cannot open $filename: $!\n";
+ while (my ($line) = <FILE>) {
+ print $line;
+ }
+}
+