perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Smith <...@sanger.ac.uk>
Subject Re: Apache2 filter
Date Fri, 02 Oct 2015 08:19:27 GMT
perl -cw sometimes throws errors with mod_perl code - as it isn't 
running in the Apache
environment...

I get the same warning testing my output filter handler when running 
with -cw - but it
works well in Apache...!

On 10/1/2015 6:59 PM, A. Warnier wrote:
> Hi.
>
> I am trying to write an Apache2 request filter.
> According to the online tutorial 
> (http://perl.apache.org/docs/2.0/user/handlers/filters.html#Output_Filters). 
> I have this so far :
>
> package MyFilter;
> ...
> use base qw(Apache2::Filter);
> ...
> use constant BUFF_LEN => 4096;
>
> sub handler : FilterRequestHandler {
>     my $f = shift;
>     my $content = '';
>
>     while ($f->read(my $buffer, BUFF_LEN)) {
>         $content .= $buffer;
>     }
> }
>
>  but when I compile this :
>
> aw@arthur:~/tests$ perl -cw PAGELINKS.pm
> Invalid CODE attribute: FilterRequestHandler at PAGELINKS.pm line 50.
> BEGIN failed--compilation aborted at PAGELINKS.pm line 50.
> aw@arthur:~/tests$
>
> platform data (from Apache log) :
> [Tue Sep 01 06:25:10 2015] [notice] Apache/2.2.16 (Debian) DAV/2 
> SVN/1.6.12 mod_jk/1.2.30 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 
> Perl/v5.10.1 configured -- resuming normal operations
>
> There are already many other mod_perl modules of all kinds running on 
> that same server (but not filters).
>
> What I am missing ?
>
> André



-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 

Mime
View raw message