[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] problem with setup running under mod_perl


> But the curious bit is that setup is being called on every http request.
>  This is not what I expected -- I thought setup would be called once
> for each copy of the script and that prerun would be called for each
> request.  I verified that it's running every time by logging calls to setup.

This is an incorrect assumption.  mod_perl means that each request is
compiled (after the first call or pre-compile).  Execution still happens
on each request.  setup() is not in a BEGIN{} block, so there is no
change here from cgi-style behavior.

If you are looking for that sort of behavior, you can bubble your
expensive routines out similar to how Apache::DBI does it.  I think The
Perl Review had a nice article on Singletons:
http://www.theperlreview.com/Issues/v0i1.shtml

-- 
SwiftOne
suppressed

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.