#!/usr/bin/perl -wT print "Content-type: text/html\n\n"; use CGI; #Import CGI module. use CGI::Carp qw( fatalsToBrowser ); use strict; #Use the strict pragma. #Declare variables. my ( @array,$f_name, $f_reason, $f_email, $f_areacode, $f_exchange,$f_pnumber,$f_response,$f_urgent,$f_textarea ); my $q = new CGI; #Create new object reference for CGI. $f_name = $q->param("f_name"); #Assign form vars to variables. $f_reason = $q->param("f_reason"); $f_email = $q->param("f_email"); $f_areacode = $q->param("f_areacode"); $f_exchange = $q->param("f_exchange"); $f_pnumber = $q->param("f_pnumber"); $f_response = $q->param("f_response"); $f_urgent = $q->param("f_urgent"); $f_textarea = $q->param("f_textarea"); #Place form data in an array. @array = ("$f_name", "$f_reason", "$f_email", "$f_areacode $f_exchange $f_pnumber", "$f_response", "$f_urgent", "$f_textarea", "\n"); #Open the file feedback.txt for appending. open(FH, ">>feedback.txt") or die "Couldn't open file: $!\n"; foreach (@array) #Iterate over the array printing all field in the file. { print FH "$_\n"; } close FH; #Close the file. print <

Thank You. You will be contacted by $f_response shortly.

EOF #End of 'here' document.