in reply to Re^2: STDIN refuses input
in thread STDIN refuses input
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
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> :)read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
Hope this helped, and best wishes.
--Chris
Yes. What say about me, is true.
|
|---|