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

Re: [cgiapp] problem with setup running under mod_perl


Hi,

My CGI::App code is supposed to be running under mod_perl via
Apache::Registry.

But the curious bit is that setup is being called on every http request.

It might not be what you expected, but this is what will happen.
Apache::Registry will just run your instance script from first to last line. There is no special magic to make CGI::App behave any different under mod_perl than under plain CGI.

CGI::App->setup is supposed to do initial setup for every request.
You have to put your global setup code somewhere else.

If you want to have something run only for the first request, chances are you might want to have it run right at server startup.
Make a mod_perl startup file and include this into your httpd.conf.

Or, if you think this is too global a setting, put some code into your application module OUTSIDE of any methods. This will get executed when the module is first loaded and compiled, usually also at server startup.

Regards,

Thilo


---------------------------------------------------------------------
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.