Could someone tell me why I'm getting a "page not found"error on this script?I understand that it could be a number of reasons, but if something obvious pops out at you..please let me know.
#!usr/local/bin/perl
use strict;
use CGI;
$query =new CGI;
$guest_file = "../new_guestbook.html";
&print_page_start;
if ($search_name = $query->param('search_name')) {
eval {
open (GUESTS, "< $guest_file") or
die "Can't open $guest_file: $!";
while (<GUESTS>) {
chomp;
($name, $email, $comments) = split /::/;
if ($name =~ /$search_name/i {
print "$name<BR>\n$email<BR>\n$comments<BR>\n<HR>\n";
}
}
}
}
else {
print "<FORM>\n";
print "<INPUT TYPE=\"text\" NAME=\"search_name\"><BR>\n";
print "<INPUT TYPE=\"submit\">\n";
print "</FORM>\n";
}
chomp $@;
if ($@) {
print "ERROR: $@<BR>\n";
}
&print_page_end;
sub print_page_start {
print $query->header;
print "<HTML>\n<HEAD>\n<TITLE>Search for Records</TITLE>\n";
print "</HEAD>\n<BODY>\n";
print "<H1>Search for Records</H1>\n;
}
sub print_page_end {
print "</BODY>\n</HTML>\n";
}
update by neshura