Listing 1. Code for handlesurvey.cgi
#! /usr/local/bin/perl
require("cgi-lib.pl");
&ReadParse(*input);
if ($input{'SUBMITWRONG'} eq 'Information is Incorrect') {
print "Location: http://fly.hiwaay.net/~rcfinch/survey.html\n\n";
}
else {
open(MAIL, "| mail rcfinch") || die "Can't open mail program\n";
print MAIL "
\n\n";
print MAIL "NAME: $input{'FIRSTNAME'} $input{'LASTNAME'} \n";
print MAIL "GENDER: $input{'GENDER'} \n";
print MAIL "LOCATION: $input{'CITY'}, $input{'STATE'}, $input{'COUNTRY'} \n";
print MAIL "EMAIL ADDRESS: $input{'EMAIL'} \n";
print MAIL "SEND INFO: $input{'SENDINFO'} \n";
print MAIL "COMPUTER SYSTEM: $input{'SYSTEM'} \n";
print MAIL "INTERESTS: $input{'INTERESTS'} \n";
print MAIL "COMMENTS: $input{'COMMENTS'} \n";
print MAIL " | \n
\n";
close MAIL;
print "Location: http://fly.hiwaay.net/~rcfinch/survey/surveythankyou.html\n\n";
}