We obviously do not have access to a request object during a BEGIN {}
block, but if I have a bunch of PerlSetVar things that I don't want to
re-initialize every time handler() is called for speed reasons, what is
the most elegant way to have an initialization sub that needs access to
things set
How about:
package ModPerlPackage;
use vars qw( $is_init );
$is_init = 0;
sub handler($) {
...
$is_init = initialize($r) unless $is_init;
...
}
Just making initialize return a true value on success.
There's undoubtedly a much more subtle solution...
HTH
Jim