modperl_args_and_params_prob

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Subject: Args and Params.
From: Justin Wheeler <firehawk@directionsolutions.com>
Date: Fri, 25 Aug 2000 15:52:36 -0400 (EDT)

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?

===

Subject: Re: Args and Params.
From: "T.J. Mather" <tjmather@thoughtstore.com>
Date: Fri, 25 Aug 2000 16:32:58 -0500 (CDT)

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

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu