perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [mp2] trouble reading post using
Date Wed, 01 Oct 2003 22:51:26 GMT wrote:
> 1. Problem Description:
> I have trouble getting iniformation from CGI-forms sent by HTTP/POST. To reproduce 
> the problem; use the testpackage I've written and included in section 5 of this 
> mail. I've also included what I've found relevant from my mod_perl/Apache-setup 
> in section 4.
> My observation is that there is no problem using GET to transfer form-data,
> but no data at all is avaliable through $q->param when using POST.
> I have tested this with different versions of mod_perl (1.99_09, snapshot
> from cvs this sunday and finally 1.99_10 released yesterday) and
> (2.93, 3.00) - as for now I run mod_perl 1.99_10 and 3.0.
> If there is something in my setup that causes this, please point me in the
> right direction or maybe towards the right documentation. - It is not
> totally neccessary for me to use, the most important is to receive
> the data ;)
> ----BEGIN sample from commonapache2.conf -----
> 	<IfModule mod_perl.c>
> 		PerlOptions +GlobalRequest
> 		PerlModule CGItest
> 		<Location /CGItest>
> 			SetHandler modperl
> 			PerlResponseHandler CGItest
> 		</Location>
> 	</IfModule>
> ----END sample from commonapache2.conf -----

Thanks for a very good bug report, Christian.

The problem is very simple. with 'Sethandler modperl' STDIN is not 
tied/perlio'ed so sees no POSTed data.

The solution is to use 'SetHandler perl-script'. I guess we may need to 
provide a new PerlOptions to enable tied STDIN/STDOUT on demand.

If you have a bit of spare time, another solution is to fix to use 
$r->read(STDIN...) instead of read(STDIN...) if $r is available. Should be a 
trivial patch. And then submit it to Lincoln (and may be CC the modperl list 
so we can approve it for Lincoln to have a better incentive to include your 
patch ;)

besides, since you use 'CGI->new($r)', i.e., passing $r to you don't 
need PerlOptions +GlobalRequest. Though it's unrelated to your problem.

Once Apache::Request 2.0 will be finished (you can already give it a try as it 
should work, see: you won't need any of the 
above and it'll just work with 'Sethandler modperl'.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message