[cgiapp] Re: CAP::AutoRunmode not working with mod_perl again ??

Rhesa Rozendaal perl at rhesa.com
Sun Nov 9 14:23:51 EST 2008


Richard Jones wrote:
> Mark Stosberg wrote:
>> On Fri, 07 Nov 2008 13:44:40 +0000
>> Richard Jones <ra.jones at dpw.clara.co.uk> wrote:
>>
>>> I know this was supposed to be fixed in v0.14 but it seems to be 
>>> happening again. In a trivial setup:
>> That sounds frustrating Richard. I haven't gone back to use AutoRunmode after
>> getting bitten the first time around with the mod_perl issue. Have you tried
>> the RunmodeDeclare plugin as an alternative?
> 
> Hi Mark,
> 
> Yes I have - and it does now seem to work OK under all 3 envs (mod_perl, 
> HTTP::Simple::Server/CA::Server & mod_cgi), but I'm still a little wary 
> of it as it seems to use deeper magic than AutoRunmode, and I'm not sure 
> all the issues that were discussed earlier [RFC: declarative run modes 
> (inspired by Method::Signatures)] have been addressed. Is RunmodeDeclare 
> 'safe' to use in production in combination with many other plugins (eg 
> CAP::Authentication, CAP::Authorization, etc) yet?


As far as I know, we fixed all the issues mentioned in that thread. I've been 
using RunmodeDeclare in production for a couple of weeks now, and it works 
fine. Since we have quite a few customers running their (online) business on 
our software, I tend to be careful with what I put into production. And I'm 
quite comfortable running it.

We use at least the following plugins in our apps:

CA::Dispatch
CAP::AutoRunmode
CAP::Session
CAP::Authentication
CAP::Authorization


> The choice actually is a) fix AutoRunmode - preferable as my app. is 
> already working with it (except under mod_perl); b) switch to 
> RunmodeDeclare, where I will have a lot of code to convert and is pretty 
> much a one-way ticket; and c) revert to the traditional method of 
> declaring $self->run_modes & $self->start_mode in setup(), which can 
> probably be considered the safer option.


We use all three methods of registering run modes in our application: we 
started out with the traditional way of calling "run_modes", "start_mode" and 
"error_mode" in "setup". Later on, we adopted CAP::AutoRunmode for newer code, 
and recently I've been moving us over to RunmodeDeclare in new cgiapp modules, 
or when I have a need to refactor existing code. All three methods run happily 
together. In fact, you could use all three in the same module, but I wouldn't 
recommend that from a maintainability viewpoint.

HTH,
Rhesa


More information about the cgiapp mailing list