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"