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

(I seem to be having a tremendous amount of trouble getting my point across.)

I don't want the END blocks to run at script (request) end; I want them to run when the child exits.

I do have "PerlHandler Apache::Registry" in place, which should mean that the END blocks run when the child exits. They aren't, and I'm trying to figure out why.
--
Jeff Boes
Database Engineer
Nexcerpt, Inc.
vox 269.226.9550 ext 24
fax 269.349.9076
 http://www.nexcerpt.com
...Nexcerpt...Connecting People With Expertise

Replies are listed 'Best First'.
Re: Re: Re: Don't understand END blocks in mod_perl
by CountZero (Bishop) on Sep 26, 2003 at 21:41 UTC

    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