The gist of this big patch is simple.
1) Now only registered packages will snap END blocks from PL_endav under perl-script (and a user has a complete control if they want any extra packages to be registered and their END blocks to be run).
2) the END blocks are now run by the child processes (they weren't before, since they were never moved out of PL_modglobal into PL_endav).
Awesome!
:)
A few remaining END blocks issues:
1) we probably should *not* run END blocks inherited from the parent process, otherwise we have BEGIN blocks run once in the parent, and END blocks run N times (once in the parent and once in each child process). So we should probably reset PL_endav in child_init.
Yes, this makes sense and it's the assumption I would make as a user.
Actually, I'm not sure it's a good idea after all. Normally fork() inherits END blocks in perl:
% perl -le 'END { warn "$$: This is the end"}; fork'
8912: This is the end at -e line 1.
8911: This is the end at -e line 1.So if we want to keep things indentical to perl we should keep it?
Looking at mp1, it doesn't run END blocks in the child processes. I guess noone needed that feature.
Actually I found that problem when Apache-Test wasn't cleaning files/dirs it created at run time and supposed to cleanup via an END block.
So now I'm a bit puzzled what's the best course to take.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
