I've run into this before as well, and what i ended up doing to get around
it was keeping the original $r around long enough to call filter_register.  

my $r = shift;
my $req = Apache::Request->new($r);  
$r = $r->filter_register(); 

adam


> -----Original Message-----
> From: Trevor Phillips [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 05, 2001 2:21 AM
> To: ModPerl Mail List
> Subject: Apache::Filter upgrade issues...
> 
> 
> Hi! I recently upgraded a test server to a recent 
> Apache::Filter, and hit
> problems due to the new dependency on filter_register() being 
> called. I
> don't mind upgrading my filters to call this, but I have one, 
> in which I
> use Apache::Request (a sub-class of Apache), which I cannot 
> seem to work
> around.
> 
> The guts of the code goes something like this:
> 
> sub handler
> {
>    my $r = shift;
>    my $IsFilter = ($r->dir_config('Filter') =~ /^on/i?1:0);
>    $r = Apache::Request->new($r);
>    if ($IsFilter)
>    {
>       $r = $r->filter_register();
>       my ($fh, $status) = $r->filter_input();
>       return $status unless $status == OK;  # The Apache::Constants OK
>       my @file = <$fh>;
>    }
> etc...
> }
> 
> The above code fails in that the extra methods provided by 
> Apache::Request
> are
> no longer there.
> 
> The above code worked fine previously (prior to the requirement of
> filter_register)...
> 
> Any ideas? How can I use both Apache::Filter and 
> Apache::Request together?
> 
> --
> . Trevor Phillips             -           
http://jurai.murdoch.edu.au/ . 
: CWIS Systems Administrator     -           [EMAIL PROTECTED] : 
| IT Services                       -               Murdoch University | 
 >------------------- Member of the #SAS# & #CFC# --------------------<
| On nights such as this, evil deeds are done. And good deeds, of     /
| course. But mostly evil, on the whole.                             /
 \      -- (Terry Pratchett, Wyrd Sisters)                          /

Reply via email to