perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stathy Touloumis" <stathy.toulou...@edventions.com>
Subject RE: How to check the return status?
Date Mon, 17 Dec 2001 15:58:56 GMT
Perhaps something along the lines of :

$r->push_handlers(
    PerlHandler => sub {
        my $r = shift;
        my $return = $handle->handler( $r );
        if ( $return == Apache::Constants::OK ) {
            ??
        }
    }
);

> -----Original Message-----
> From: Alexei V. Alexandrov [mailto:ava@elcomsoft.com]
> Sent: Monday, December 17, 2001 9:45 AM
> To: modperl@apache.org
> Subject: How to check the return status?
> 
> 
> Hello everyone,
> 
>   I have a question that i can not resolve. The module dynamicaly
>   loads other modules to handle specific urls like this:
> 
>   [snip]
>         my $handle = 'My::Module';
>         
>         eval {
>                 (my $h = $handle) =~ s!::!/!ig;
>                 require $h . ".pm";
>         };
> 
>         if (!$@) {
>            if ($handle->can( "handler" )) {
>                 $r->handler( "perl-script" );
>                 $r->push_handlers( PerlHandler => 
> \&{"${handle}::handler"} );
>                 ??
>            }
>         }
>   [snip]
> 
>   In this way the control is passed to another module. The module can
>   return OK, SERVER_ERROR, etc... How can i check the return status so
>   i can handle it (cache the output for example if the module returned
>   OK)
> 
>   Thanks for any advice.
>   
> --- 
>  Best regards,
>  Alexei V. Alexandrov
> 

Mime
View raw message