On Wed, 22 Nov 2000, Andrei A. Voropaev wrote:
> Hi!
>
> Everyone knows that END handlers in packages under mod_perl are executed
> only when apache terminates. But from time to time there might be a need to
> execute something when the Request is finished.
>
> In practice what I do in these cases is install PerlCleanupHandler which
> checks all loaded packages and if they define 'END_REQUEST' function then
> execute that function.
>
> Maybe it's worth making it standart feature of mod_perl?
considering you can do this:
package My::Module;
$Apache::ReadConfig::Location{'/'}->{PerlCleanupHandler}
= join '::', __PACKAGE__, 'cleanup';
sub cleanup {
my $r = shift;
warn "cleanup in $$\n";
}
cleanup() will be called without touching httpd.conf.
a small module to cut down the noise should do the trick for you.
checking all packages by default would be far too expensive to be a
standard feature.