I am using subroutine attributes with CGI::App to automatically register run-modes (rather than having
to set them up manually)
package MyApp;
use base 'CGI::Application';
use CGI::Application::Plugin::AutoRunmode
qw [ cgiapp_prerun];
sub my_run_mode : Runmode {
# do something here
}
sub another_run_mode : Runmode {
# do something else
}
# you now have two run modes
# "my_run_mode" and "another_run_mode"
The
module is still somewhat experimental, and hence not yet on CPAN, but if you want to give it a spin:
perldoc download