Here's a way to do "by hand":

Please don't do this. It is shown here for illustrative purposes only

## First, grab any GET stuff (overrrides POST) if ($ENV{'REQUEST_METHOD'} eq "GET") { $sinstring = $ENV{'QUERY_STRING'} } ## Could change this to a simple "if" to allow GET *and* POST elsif ($ENV{'REQUEST_METHOD'} eq 'POST' && $ENV{'CONTENT_TYPE'} eq "application/x-www-form-urlencoded") { ## Okay if CONTENT_LENGTH is 0... read(STDIN, $sinstring, $ENV{CONTENT_LENGTH}); } else { ## Last ditch efforts, no REQUEST METHOD found ## Any GET info? $sinstring = $ENV{'QUERY_STRING'}; ## Any POST info? $sinstring || read(STDIN, $sinstring, $ENV{CONTENT_LENGTH}); } ## Find all of our sins: for (split(/\&/, $sinstring)) { if (($sin_name, $sin_val) = /(.*)=(.*)/) { ## Normal... $sin_val =~ tr/+/ /; $sin_val =~ s/%(..)/pack('c',hex($1))/eg; } else { ## Abnormal... $sin_name = $_; $sin_val = "0"; } $sin_name =~ tr/+/ /; $sin_name =~ s/%(..)/pack('c',hex($1))/eg; $sins++; if (defined $sin{$sin_name}) { ## Allows for "0" cases.... $sin{$sin_name} .= '#' . $sin_val; } else { $sin{$sin_name} = $sin_val; } }

In reply to Re: How do I get at the parameters in my CGI program? by turnstep
in thread How do I get at the parameters in my CGI program? by vroom

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.