> > Currently I think there is a slight "bug" in the latest mod_perl 1.x,
> > where PerlRequire doesn't work as require() in Perl per se on restart. A
> > few people have reported this behavior.
> >
> > So as a quick workaround do this:
> >
> > start.pl:
> > ---------
> > require "real-startup.pl";
> >
> > this require(), won't be called twice.
>
> I know that, but my problem is that I need to call an init() function
> in a loaded library that can't be called twice ;-(

Right, put this init call into "real-startup.pl" and it won't be called
twice.

> > > I guess it could be usefull for other purposes to, so here is the patch.
> >
> > I'm not underestimating the power of your patch of course :) I think the
> > real fix should be in PerlRequire.
>
> Yeah, Matt said he could use it ;-)

sure, but that's a different matter. I say that PerlModule and PerlRequire
have a bug, which should be fixed. It's just that your problem made me
reiterate the problem.

> > BTW, the same problem happens to PerlModule. I've moved all my preloadings
> > into the Perl domain, mod_perl reloads them twice.
>
> I agree, I experienced the strange differences between PerlModule Foo &
> <Perl>use Foo;</Perl> ;-(
>
> I guess that problem couold be fixed usign perl_module->dynamic_load_handle.
> That way code like PerlModule and such could figure out if they should
> skip the first run or not.
>
> I wouldn't mind volunteering to look at this problem and suggest a fix. It's
> been annoying for a long time now.

That would be cool :)

> There is also the strange case of mod_perl leaking memory on graceful
> restarts when compiled as DSO.  But I don't feel like getting into
> this one quite yet.

True, one of the reasons why I don't use DSO. I guess Doug dedicates all
his time on 2.0, and rather not do anything else than the critical bug
fixing for 1.x. But if anybody sends a patch in, the thing will be
probably added. Doug, please correct me if I'm wrong.

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Reply via email to