You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Rob Bloodgood <ro...@empire2.com> on 2001/06/19 00:35:00 UTC

Adding parameters to a request

In my AuthenHandler, I run the following snippet:

	# validation successful
	$apr->subprocess_env(REMOTE_PASSWORD => $pass);
      my $args = $apr->args || '';
	$apr->args( $args . ( length $args ? '&' : '' ) . "pid=$pid" )
           unless $args =~ /pid=\d+/;
	return OK;

The intent is to add the parameter 'pid=99' or whatever to the request if it
is not already present.

It feels clunky and forced to me... is there a better way to do this?  As
indicated by the variable, I'm using Apache::Request, for the sole purpose
of having easier access to the parameters.  Except that it turns out
Apache::Request's param() method does NOT support *setting* parameters, only
*getting* them. <sigh>

TIA!

L8r,
Rob