Skip Menu |

This queue is for tickets about the CGI-Application-Plugin-AutoRunmode CPAN distribution.

Report information
The Basics
Id: 17143
Status: resolved
Priority: 0/
Queue: CGI-Application-Plugin-AutoRunmode

People
Owner: Nobody in particular
Requestors: MARKSTOS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.12
Fixed in: (no value)



Subject: Fails to register runmodes under mod_perl
After moving a project to mod_perl (1.x), The subroutine attribute style of run mode declaration quit working. The exact behavior was silent failure-- The default "start" run mode would be loaded instead. I didn't dig to find the root cause of this. Instead, I ripped out this use of AutoRunmode so I could get on with the project. Perhaps this plugin /is/ compatible with mod_perl and there was something additional in my environment that combined to create the failure.
It seems that Attribute::Handlers has some problems with mod_perl. Could you check if disabling A::H fixes the issue? AutoRunmode tries to use A::H, but also has a fallback mode if A::H is not available. You can force not to use A::H by changing BEGIN{ eval 'use Attribute::Handlers; $has_ah=1;'; to BEGIN{ # eval 'use Attribute::Handlers; $has_ah=1;'; at the beginning of AutoRunmode.pm.
I believe to have found and fixed the problem in 0.14. It seems that Attribute::Handler by default relies on code running in the CHECK phase, which is problematic when used with mod_perl. I moved the attribute handlers into the BEGIN phase, and that seems to work now.