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.


In reply to Re: HTTP 200 Status by Sagacity
in thread HTTP 200 Status by dmsparts

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.