PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > Perl
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools
Old 5-22-03, 05:01 PM   #1
bkimelman
Guest
 
Posts: n/a
Question 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 :

#!/usr/bin/perl -w

use CGI; # load CGI routines
use Data:umper;
use English;

$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 ?
 
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:56 AM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright © 2000-2007 Jelsoft Enterprises Limited.