in reply to Re: Re: Re: RFC : Pragma vs. Module
in thread RFC : Pragma vs. Module
This makes sense that any of the compilation phases BEGIN, CHECK, INIT etc. would not work 100% as expected when eval-ed. They are for affecting the compilation during compile-time, and eval is a run-time construct.
As for the assertion that this will not work with mod_perl, you are partially right. To start, Apache::Registry and similar CGI-to-mod_perl tools do eval the files as strings in order to run them in the persistant mod_perl environment. But this is only one very small (but very commonly used) aspect of mod_perl. The rest of mod_perl is handlers (for each of the Apache request cycles), and while I have not tested this assertion, I am pretty sure that INIT blocks as well as BEGIN, CHECK & END all run perfectly fine.
-stvn
UPDATE:
Wow, was I wrong. Apparently mod_perl evals everything, handlers and all, see my apology to Liz below.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: RFC : Pragma vs. Module
by ysth (Canon) on Mar 14, 2004 at 23:30 UTC | |
by theorbtwo (Prior) on Mar 15, 2004 at 09:42 UTC | |
by ysth (Canon) on Mar 15, 2004 at 14:28 UTC |