#!/usr/bin/perl use strict; use CGI qw(:standard); my @logs = qw(/var/log/httpd/error_log /var/log/httpd/access_log /var/log/mysqld.log); my $log = $logs[0]; $log = $logs[param('log')] if param('log') =~ /1|2/; print header(); print start_html(-title=>$log); print '
'; open(LOG, $log)||warn "cannot open $log: $!\n"; print while('; print end_html();); print '