perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <>
Subject Re: Using Apache::FakeRequest and DAD
Date Wed, 01 Mar 2000 06:41:55 GMT
On Thu, 17 Feb 2000, Michael Finke wrote:

> Our setup:
> 	Apache		1.3.11
> 	DAD		2.02(Modified)
> 	mod_perl	1.21
> 	FakeRequest	1.0
> Our project:
> 	We're working on dynamically generated pages, which need to
> include advertisements pulled out of DAD.  We are working on pages which
> will have the same content, yet are wrapped by unique headers and footers
> depending on the site from which the pages are hit.  The headers and
> footers are both perl scripts which determine the appropriate
> header/footer to tack on.  It then reads the proper flat HTML file and
> splats it back to the screen.  
> The problem:
> 	We're using Apache::FakeRequest to spoof DAD into returning the ad
> data back into a variable so we can insert it into the page where it is
> needed.  The problem we're having though is getting $r->args to set
> correctly.  We've tried everything we could think of, to no avail.  No
> matter what we pass to FakeRequest, $r->args is only getting the first
> item we pass.  The errors we are getting are: "Odd number of elements in
> hash assignment at /usr/local/apache/perl/DAD/ line 109."  
> 	Anyone know how to get $r->args set properly on a FakeRequest so
> we can kill these two errors that keep spamming our logs?

Apache::FakeRequest::args doesn't parse the string in a list context.
if you look at all the methods are generated and end up
calling this:
sub elem {
    my($self, $key, $val) = @_;
    $self->{$key} = $val if $val;

you could take `args' out of the @methods list and implement a version
that behaves as Apache::args does under mod_perl, patch is most welcome.
i'll add it to the ToDo list for now.

View raw message