Okay, I am kinda stuck. I am now experimenting with CGI on Activestate Perl in Windows and have got an Apache server. I am trying to use the info entered in the comments box so that for every word entered I can take this as a variable to use in a separate program. Is this possible? Thanks for any kind of help.

My HTML Page, guestbook.html:
<html><head> <title>Guestbook</title> </head> <body> <form action="/cgi-bin/guestbook.pl" method="get"> <table> <tr><td>Comments</td><td> <TEXTAREA name="comments" rows="10" cols="32"></TEXTAREA></td></tr> </table><br><br> <input type="submit" value="Add Entry"> </form> </body> </html>
My Program, guestbook.pl:
#!/usr/local/bin/perl my $query_string = ""; #Get the input if ($ENV{REQUEST_METHOD} eq 'POST') { read(STDIN, $query_string, $ENV{CONTENT_LENGTH}); } else { $query_string = $ENV{QUERY_STRING}; } ##### We will remove this print "Content-Type: text/html\n\n"; print "Query String is \n<br> $query_string"; ##### We will remove this # Split the name-value pairs @pairs = split(/&/, $query_string); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); #Converting Hex to English. $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $FORM{$name} = $value; } @thanks = split (/ /, $FORM{'comments'}); foreach $thank (@thanks){ $FORM{$thank} = $thank; } #Give output print <<END; Content-Type: text/html\n\n <html><head> <title>Guest book Result</title> <body> <h1 align="center">Guest book Results</h1> <br> Comments : $FORM{'comments'} <br> Words: $FORM{$thank} </body> </html> END

In reply to Taking Variable from Form Entry Using CGI by sdslrn123

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.