Laura,

What you need to understand is how the CGI process works. You have a slightly different environment to the traditional unix shell setup. While STDOUT certainly exists - if your CGI program is generating a web page "on the fly", STDOUT is what is passed back to the web server, and then to the user's browser.

What you do have is (and I will try to show it diagramatically):

User ======> Web Server =====> (CGI request via GET requests sees CGIExec or POST) URL page type * program gets paramaters * generates web page ohhahh<===== sends page <===== * sends page through STDOUT users back in the sees my standard http wonderful manner generated page
So the only way for the user to interact with the cgi program is via values passed to the browser, either as part of the url (the GET method) or associated in a pseudo file (POST). If you are using CGI.pm (the recommended way), then these values are presented to your CGI program in a consistent, easy to access way.

Hope this helps. You can look at the CGI.pm documentation at http://stein.cshl.org/WWW/software/CGI/cgi_docs.html - Lincoln Stein is probably the expert on CGI perl programs.


In reply to Re:(Maclir) Re: (Ovid - CGI or command line?) Re(3): Prompting user input (newbie) by Maclir
in thread Prompting user input (newbie) by lauragarcia

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.