You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Justin Wheeler <fi...@directionsolutions.com> on 2000/08/25 21:52:36 UTC

Args and Params.

While writing an apache module, using mod_perl 1.24, I followed the
instructions in my "Writing Apache Modules with Perl and C" book.  The
book told me to get at all parameters, 

	my %params;
	my @args = ($r->args, $r->content); # This line is the line in question.
	while (my($name, $value) = splice @args, 0, 2) {
		push @{$params{$name}}, $value;
	}

The line I commented stops Apache from doing anything.. the code just
halts.  If I don't send anything in POST or GET form, it runs fine, and
feeds the pages.  But if I do send any data, it will stop
running.  CGI::param, however, works fine.  I would prefer not to use it
if I don't have to though.  Bug?

--
Regards,
Justin Wheeler
firehawk@datademons.com




Re: Args and Params.

Posted by "T.J. Mather" <tj...@thoughtstore.com>.
I'm not sure about this but the problem might be that CGI is attempting to
read the POST data first, and since POST data can only be read from the
socket once, $r->content hangs.

You might want to look into either

1. caching POSTed Data:
http://perl.apache.org/guide/snippets.html#Caching_POSTed_Data

2. using Apache::Request, a module that implements the
CGI::param method, but does it in mod_perl and is a lot faster