This plugin for CGI::Application provides easy
ways to setup run modes. You can just write
the method that implement a run mode, you do
not have to explicitly register it with CGI::App anymore.
There are two approaches:
=item Declare run modes with subroutine attributes.
You can flag methods in
your CGI::App subclass with the attribute "Runmode" or "StartRunmode" (these
attributes are case-insensitive)
=item Declare that every method in a class is a run mode.
You can assign a
delegate object, all whose methods will become runmodes
You can also mix both approaches.
Delegate runmodes receive two parameters: The first one is the CGI::App
instance, followed by the delegate instance or class name. This can be useful
if you have delegate objects that contain state.
It is possible to chain multiple delegates by specifying an array reference
containing the delegate instances or class names. This chain is
checked from left to right and the runmode will be delegated to the first match.
It both cases, the resulting runmodes will have the same
name as the subroutine that implements them. They are activated
by a cgiapp_prerun hook provided by this plugin (if
you are using CGI::Application older than version 4, hooks
are not available, and you can import a cgiapp_prerun method