in reply to HTTP 200 Status

This is not tested, but should get you close enough

#!/usr/bin/perl sub emailreply{ use strict;#comment this out after debugging, but leave it here for yo +ur next adventure use CGI; my $q = CGI->new(); $q->ReadParse(); my $smsreplydir = 'd:\inetpub\wwwroot\cgi-bin\classads\test'; my $from = $q->{ "from" }; my $msg = $q->{ "text" }; my $msgid = $q->{ "msgid" }; open (SMSREPLY, ">>$smsreplydir/abc.txt"); print SMSREPLY "\n $msgid\n $from\n\n $msg\n\n"; close SMSREPLY; print $q->header(); #sends your HTTP 200 OK header to the browser, you + can control alot of this info yourself print $q->start_html();#handles the html body tag #There are more subs that can handle all of your html needs, tables, e +tc. print "Thanks for your input. The information has been forwarded to th +e Big Cheese.\n";#Change this to your liking print $q->end_html();#End the html page properly }

Check out http://search.cpan.org/~lds/CGI.pm-3.25/CGI.pm#PRAGMAS

The style of your original script needs to be updated to the better supported OO style that uses modules and packages

I remember seeing this type of scripting back in the days of cgi-lib.pl

Check to see if use CGI is already called, if it is, set a different scalar for CGI->new() instead of $q.

You may use any scalar you want, but $q might be used elsewhere in the scripting.