deriwana has asked for the wisdom of the Perl Monks concerning the following question:
update by neshura#!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"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI Configuration Woes (was: newbie alert)
by Hero Zzyzzx (Curate) on Jun 19, 2001 at 00:21 UTC | |
Re: newbie alert
by buckaduck (Chaplain) on Jun 18, 2001 at 23:32 UTC | |
Re: CGI Configuration Woes (was: newbie alert)
by scottstef (Curate) on Jun 19, 2001 at 17:49 UTC | |
Re: newbie alert
by deriwana (Initiate) on Jun 18, 2001 at 23:24 UTC | |
by foogod (Friar) on Jun 19, 2001 at 00:21 UTC |