perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [mp2] scalar $r->args() misbehaves with apache::compat.
Date Thu, 10 Feb 2005 00:18:45 GMT
Joe Schaefer wrote:
> Stas Bekman <stas@stason.org> writes:
> 
> 
>>Max Baker wrote:
>>
>>>-------------8<---------- Start Bug Report ------------8<----------
>>>1. Problem Description:
>>>[mp2] While using Apache::compat C<scalar $r->args()> returns
>>>"Apache::Request::Table=HASH(0x98d0ef8)".
>>>It should return the full query string.
>>
>>Did you forget to attach the patch, Max?
>>
>>It should be as simple as returning $r->args if wantarray is
>>false. it's a pure perl code after all.
> 
> 
> Err, that looks like an apreq2 flub to me.  I suspect
> Apache::compat is irrelevant; $r is probably an Apache::Request 
> object above, so $r->SUPER::args might do what he wants.

Joe is right, this has nothing to do with modperl, since Apache::compat 
already does what I've suggested:

sub Apache::args {
     my $r = shift;
     my $args = $r->args;
     return $args unless wantarray;
     return $r->parse_args($args);
}

most likely your $r is not the original $r, but one re-blessed into 
Apache::Request (the original is Apache::RequestRec).


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message