in reply to Does CGI.PM process input data
Now to do it with CGI, do this:if ($ENV{'REQUEST_METHOD'} eq "GET") { $form_data = $ENV{'QUERY_STRING'}; }else { $form_data = <STDIN>; }
#!/usr/bin/perl use CGI; my $q = new CGI; my %param = $q->Vars; #To check whether the params were sent via POST, do: my $method = $q->request_method(); print "$method\n"; #which should give either 'POST', 'GET' or 'HEAD'.
There are alot of cute CGI scripts out there to help in debugging, just google for them. For instance:
#!/usr/bin/perl use warnings; # arg_echo.cgi - print all form values use strict; use CGI qw/:standard/; $|=1; print "Content-type: text/plain\n\n"; foreach my $name ( param() ) { print "$name: '", param($name), "'\n"; }
|
|---|