in reply to Re: Re: Don't understand END blocks in mod_perl
in thread Don't understand END blocks in mod_perl

If you are running your script under Apache::Registry then your END-block will run when the script ends: Apache::Registry emulates the behaviour you see when running your scripts under (mod_)cgi.

Quoting from Beckman & Cholet's "Practical mod_perl", p. 241:

As you already know by now, Apache::Registry handles things differently. It does execute all END blocks encountered during compilation of Apache::Registry scripts at the end of each request, like mod_cgi does. That includes any END blocks defined in the packages use()d by the scripts.
So if you want your END block to run at the child's exit only: don't use Apache::Registry or register your PerlChildExitHandler (Apache 2).

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

  • Comment on Re: Re: Re: Don't understand END blocks in mod_perl