http://www.perlmonks.org?node_id=815372


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. :(