use strict; use CGI; print "Content-type: text/html\n\n"; my $query = new CGI; print $query->start_html(-title => "Thanks"); # Append to the guestbook, if possible if (open(GUESTBOOK, ">>/tmp/guestbook.html")) { print GUESTBOOK $query->param("name"), "\t", $query->param("address"), "\t", $query-param("comments"), "<HR>\n\n"; close(GUESTBOOK); # Print information for the user print "<P>The following comments were saved: </P>\n"; print "<P>Name: ", $query->param("name"), "</P>\n"; print "<P>Address: ", $query->param("address"), "</P>\n"; print "<P>Comments: ", $query->param("comments"), "</P>\n"; } # Produce an error message if we cannot append else { print "<P>Could not open the guestbook!</P>\n"; print "<P>Sorry; please try another time</P>\n"; } print $query->end_html;