Hi Mike,

On Fri, 8 Feb 2002, Mike McLagan wrote:

>    My message is about data space.  The data space for the modules does not 
> seem to be recreated or reinitialized (BEGIN blocks are not rerun) from one 
> invocation of a script to another.

Yes, this is well known to mod_perl users and it's in the Guide, in
the same chapter that I've already suggested that you read:

=head1 BEGIN blocks 

Perl executes C<BEGIN> blocks as soon as possible, at the time of
compiling the code. The same is true under mod_perl. However, since
mod_perl normally only compiles scripts and modules once, either in
the parent server or once per-child, C<BEGIN> blocks in that code will
only be run once.  As the C<perlmod> manpage explains, once a C<BEGIN>
block has run, it is immediately undefined. In the mod_perl
environment, this means that C<BEGIN> blocks will not be run during
the response to an incoming request unless that request happens to be
the one that causes the compilation of the code.

If you are having trouble coping with mod_perl and CGI.pm perhaps it
would better if you tried different approach, Apache::Request for
example has some useful features.

73,
Ged.



Reply via email to