perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Apache::Request vs Apache->request
Date Tue, 27 Jan 2004 23:35:03 GMT
Clayton Cottingham wrote:
> thanks for the reply 
> 
> here is something strange. i cant figure out based on all this, under mod perl 1 Apache/1.3.29
on FreeBSD devserver.ppw 5.1-RELEASE
> 
> below is a small piece of my module the 'parsefile' subroutine *does not* print out %args,
i dont understand why not
> can someone explain?

yup, see below

> ************
> sub handler {
>     my $r = Apache->request;
> 
>    #for upload 
>     my $apr = Apache::Request->new(
>         $r,
>         POST_MAX        => 10 * 1024 * 1024,    # in bytes, so 10M
>         DISABLE_UPLOADS => 0
>     );
> 
> #if upload object exists
>     if ( $apr->upload ) {
>         parseFile($r);
>     }
>     else {
> 	#print form for upload
>         printForm($r);
>     }
> 
> }
> 
> sub parseFile {
>    my $r   = shift;
>    my $apr = Apache::Request->new(
>         $r,
>         POST_MAX        => 10 * 1024 * 1024,    # in bytes, so 10M
>         DISABLE_UPLOADS => 0
>     ) ;
>     my %args = $r->args;

of course, you create a new A::R object, you should use ->instance instead. Or 
even better pass $apr to parseFile, you don't need $r any longer, since $apr 
already $r and more.

__________________________________________________________________
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

-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message