Hi Monks,

I'd be grateful if someone could enlighten me, a humble newb. The purpose of my this script is to allow the user to add notes to a bunch of entries in a text-file. I'd like to pass a bunch of different variables to a perl/CGI script but I don't know the names of the variables (they are read from the text file). In the past, I've done this sort of thing using METHOD=GET and simply read/parsed the variables and values from the URL, but in this case I want to pass a considerable amount of text to the script (too much to go through the URL) so I'm not sure what to do. Since I don't know the names of the variables, I can't use the CGI param function as usual.

From what I've read here and elsewhere, I can use a read(STDIN) sort of thing, but that this is not compatible with CGI.pm. How to I get around this? I want to be able to read all of the POST data without knowing variable-names in advance. And I'd like to continue using CGI.pm, if possible. Help?


Thanks very much and humble apologies if this was posted elsewhere. I saw similar posts, but no answers to this precise question...


In reply to CGI.pm & STDIN question by roadnottaken

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.