|5-22-03, 05:01 PM||#1|
CGI.pm parameter fetching problem
I had a simple CGI script that was working fine, but when I added a function call to retrieve the entire parameter list as a hash (as described in perldoc CGI) the perl script dies on the very statement which is attempting to retrieve the parameters list.
The relevant portion of the CGI script is as follows :
use CGI; # load CGI routines
$query = new CGI; # create new CGI object
print $query->header, # create the HTTP header
$query->start_html('hello world'), # start the HTML
$query->h1('hello world'); # level 1 header
@names = $query->param;
%parms = $query->Vars;
print "<BR>Parameters passed to script : ",join(", ",@names),"<BR><BR>\n";
When I executed the URL which ran the CGI script, all the output that I saw was "hello world", which leads me to believe that this call to the "Vars" method is exploding. Note that when I remove the call to the "Vars" method I see all the output that I expect to see.
What am I doing wrong with the "Vars" method ?
Also is there a way to redirect standard errors generated by Perl back to the browser ?