Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: STDIN ..???

by atcroft (Monsignor)
on Jan 03, 2010 at 03:08 UTC ( #815372=note: print w/replies, xml ) Need Help??


in reply to STDIN ..???

Probably the two imporant items from the CGI.pm docs are the following:

  1. my @names = $q->param;, which gives all the parameter names, and
  2. my @values = $q->param('foo');, which would allow for multi-valued entries.

Hope that helps.

Replies are listed 'Best First'.
Re^2: STDIN ..???
by skx (Parson) on Jan 03, 2010 at 03:17 UTC

    Yes this is the solution. The following is a simple demonstration that should be useful to the OP:

    #!/usr/bin/perl use strict; use warnings; use CGI; # print a simple content-type which will ensure we're not at # risk of XSS attacks, etc. print "Content-type: text/plain\n\n"; # get the CGI object my $cgi = new CGI; # for each parameter submitted foreach my $param ( $cgi->param() ) { # print the parameter and the value it contained. print $param . " " . $cgi->param( $param ) . "\n"; }
    Steve
    --
      # print a simple content-type which will ensure we're not at # risk of XSS attacks, etc. print "Content-type: text/plain\n\n";

      Just throwing this out there. IE does not respect content type headers over some of its other content heuristics and some servers write their own headers no matter what the CGI sends. So that might not be safe in edge cases. :(

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://815372]
help
Chatterbox?
[erix]: nobody knows what kind it takes :)
[erix]: I say his seems a face that launches a thousand missiles :)
[Your Mother]: I say I do. :P
[Your Mother]: Missiles would be an idiotís play. Putin is many things but he is not an idiot.
[erix]: I like the idea of the trumps troup of imbeciles growing slightly nervous now their incompetence will be tested
[erix]: you seem forget there is another idiot coming :)
[Your Mother]: The US government does not attract talent, but grafters and liars and it has been that way for the better part of a century. FEW exceptions.
[erix]: you think it only /looks/ worse this time?
[Your Mother]: HR Clinton was literally threatening Russia. She would have been MUCH more likely to start real trouble.
[Your Mother]: I think there is less decorum this time.

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2017-01-20 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (173 votes). Check out past polls.