$r-dir_info and BEGIN {}?

2000-12-28 Thread Rafael Kitover
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

Re: $r-dir_info and BEGIN {}?

2000-12-28 Thread Jim
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