#!/usr/bin/perl
#
# print header stuff
#
print "Content-type: text/html", "\n\n";
print "<html>\n";
print "<body background=\"nevada.gif\">\n";
#
#define stuff to grab data entered on form
#
require TripodCGI;
use CGI;
$cgi = new CGI;
#
# get the file name they want to list
#
$name=$cgi->param('name');
#
#
#open the file so we can read it and print it
#
#open(ALL,"$name") or print "<h2>Error</h2>can't open file<blockquote>$name</blockquote>";
open(ALL,"$name") or nofile();
#
#read each line in the file
#
$i=0;
print "<pre>\n";
while(<ALL>) {
$i++;
print "$_<br>";
}
print "</pre>\n";
if ($i == 0 ) {
print "<h2>No E-mail addresses in the file</h2>\n";
}
#
#close the file
#
close(ALL);
exit;
sub nofile {
print "<h2>Error</h2>can't open file<blockquote>$name</blockquote>";
exit;
}