Greetings, lcole.

If I understood you correctly, I've already given you pretty much what you asked for; Take input from a web page, and respond to said input.

There are other possible variations. The way I chose to present it, was what I thought might be easiest to follow, and seemed closest to the example you presented.

From the looks of it (your script), it seems pretty old, in style. Usually taking input from <STDIN> is chosen when you are at a console, or tty/terminal (at a local computer -- within a shell). You can still use that same process within a web page. Something like

read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
But it can get pretty hairy. Because you must take additional measures to "sanitize" your input. To prevent users from entering shell commands like rm -rf /. Which could effectively delete your(hosters) file system. The commands are only limited to what is available with your hosting account, or how clever the user is, that uses your (unsanitized) input. So given that you indicate that you're fairly new to Perl. I would strongly advise against taking the <STDIN> approach. At least until you become more comfortable with Perl. But by then, I suspect you'll see that's it's probably more work than it's worth. Just to say you did it with <STDIN> :)

Hope this helped, and best wishes.

--Chris

Yes. What say about me, is true.

In reply to Re^3: STDIN refuses input by taint
in thread STDIN refuses input by lcole

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.