[cgiapp] New Plugin: RunmodeDeclare

Richard Jones ra.jones at dpw.clara.co.uk
Sun Sep 28 19:18:02 EDT 2008


Mark Stosberg wrote:
> As Rhesa proposed, he has followed through and released a plugin to add the
> Devel::Declare / Method::Signatures magic to CGI::Application:
> 
> http://search.cpan.org/perldoc?CGI::Application::Plugin::RunmodeDeclare

Looks like an interesting alternative to CAP::AutoRunmode. One minor 
irritant is having to put 'runmode foo ($c:)' everywhere (only if using 
$c instead of $self of course). Might be useful to be able to declare 
use CGI::Application::Plugin::RunmodeDeclare(invocant => '$c'), or just 
use CAP::RunmodeDeclare qw($c).

As an exercise I tried sub-classing it - 'use My::RunmodeDeclare' and 
overriding parse_proto(), substituting $c for $self in 
$signature{invocant}. It seems to work fine so far, and also works with 
CAP::AutoRunmode. Not tried it with CA::Dispatch yet though.


More information about the cgiapp mailing list