Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert cgi->param() ? 1

Status
Not open for further replies.

chasheath

Programmer
Apr 10, 2008
2
US
I need to pass cgi->param() to a function that requires declarations like :

[ foo => "bar", foo2 => "bar2" ].

The closest I've gotten was with a reference to

my @params = $cgi->param(), which was referenced as \@params, but this just gave me the keys, not the values. I tried to make @params into a hash but that got nowhere.

I'm a PHP guy trying to add something to a legacy PL script. Help! Thanks. More complete context below:

use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
my $req = ( POST ' $cgi->param() );

$res = $ua->request($req);
 
I seem to have solved it, with $cgi->Vars() instead of $cgi->params().

Is there any coherent documentation for all the various modules available for Perl? If there is, maybe I'll convert!

Thanks much ...
 
The CGI module is very well documented. It is probably the best documented perl module there is considering all that it does. You can always search for modules on CPAN and read the documentation. The documentation is also included with the module so if you have a local install of perl it will be there. You can also look up all core modules on and read the docs there.

Some modules are unfortunately not well documented (it is up to the author to write the documentation). And some of the documentation is written for rocket scientist (apparently) instead of lay persons, and can be very difficult to understand.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top