First thing you do is step up to your teacher and tell them that not using CGI (or at least a skimmed down version such as CGI::Simple) is completely idiotic. As is currently, your perl script is trying to access the form data through the GET method. It looks as though you tried to get through POST but that wasn't working. Basically, you need to change read($_, ...) to read read(STDIN, ...), but don't do that. Use CGI::Simple. Anything else is just wrong.

Update: The fact that this may be the first or second assignment in a class did not occur to me :). If this teacher is anyone decent, then it is probably as hardburn stated: it is most likely so you can see where POST data is being received from. After you have learned this area, I'm sure the teacher will not be against using a well-tested module to do the job securely. A quick thanks to hardburn for the insight.


If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.


In reply to Re: Trouble getting a Perl script to run with an HTML form by Coruscate
in thread Trouble getting a Perl script to run with an HTML form by alarthame

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.