3 #------------------------------------------------------------
6 # Web-based text file viewer.
7 # Copyright Paul Mutton, 2000.
8 #------------------------------------------------------------
16 my ($left) = "../left.inc" ;
17 my ($title) = "../title.inc";
18 my ($bottom) = "../bottom.inc";
21 my ($query) = new CGI;
22 my ($doc) = ($query->param('doc') =~ /^\s*(.*?\.txt)\s*$/);
23 $doc = "../documentation/".$doc;
25 print "Content-type: text/html\n\n";
28 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
32 Web-based text file viewer and formatter.
33 Created by pjm2 19/10/2000
34 Last modified 02/11/2000
40 <title>The i-scream Project Documentation Viewer</title>
41 <meta name="description" content="The i-scream Project is a central monitoring system for Unix, Linux and NT servers.">
42 <meta name="keywords" content="i-scream, project, central monitoring system, unix, linux, nt, server, alert">
43 <meta name="generator" content="notepad on acid, aye.">
46 <body bgcolor="#ffffff" link="#0000ff" alink="#3333cc" vlink="#3333cc" text="#000066">
48 <table border="0" cellpadding="2" cellspacing="2">
78 # Print a file, whilst escaping HTML: -
80 my ($urls) = '(' . join ('|', qw{
91 my ($gunk) = '/#~:.?+=&%@!\-';
93 my ($any) = "${ltrs}${gunk}${punc}";
95 open(FILE, $filename) or die "Cannot open $filename: $!\n";
97 # Use $_ implicitly throughout.
99 # Must do the next line first!
104 s/\b($urls:[$any]+?)(?=[$punc]*[^$any]|$)/<a href="$1">$1<\/a>/igox;
110 # Print a file without escaping HTML: -
113 print `cat $filename`;