in reply to Really, how do I get input from the keyboard.

Are you trying to get input from a CGI textbox? In that case, you need to use an HTML form with a textbox, and then use the CGI.pm module to grab the input. There isn't a way to read directly into your CGI script as a user is typing.

While it's true that CGI scripts get POST input from STDIN, you can't just do what you're trying to do without setting up a textbox in an HTML form. And as for reading the input, don't do it yourself, use the CGI.pm module's param() method.


Dave

  • Comment on Re: Really, how do I get input from the keyboard.

Replies are listed 'Best First'.
Re: Re: Really, how do I get input from the keyboard.
by jacques (Priest) on Feb 20, 2004 at 04:17 UTC
    you need to use . . . the CGI.pm module to grab the input.

    You know, I never liked param(). It's badly named IMHO. Why not call it input() or read() or received() or whatever. Is anybody with me?

      <UPDATE> Original unedited text of this node's parent preserved as follows:</UPDATE>

      There is more than one way to do it.

      Of course there is. There are thousands of ways of outputting "Just another Perl hacker.\n" too, and yet, none is easier, clearer, and more robust than:

      print "Just another Perl hacker.\n";

      When the job can be best accomplished with a hammer don't try using a heavy wrench or the heel of a shoe to drive a nail, unless of course, you're just showing off. ;)


      Dave

      I'm all over you. But I hate CGI.pm anyways, so.
        Wow. I thought bad-mouthing CGI was apostacy around the Monastery. I'd like to hear more. Anyway, in the original post, I was trying to avoid CGI, HTML, forms, etc., but now know that for my application, it won't work.

        —Brad
        "A little yeast leavens the whole dough."