package Test; use strict; use warnings; use base qw(CGI::Application); sub setup { my $self = shift; # default runmodes $self->start_mode('do_main'); $self->mode_param('m'); $self->run_modes([qw/ do_main testtt /]); } sub cgiapp_prerun { my $self = shift; $self->header_add( 'Content-type' => 'text/plain' ); } sub testtt { my $self = shift; return "test - OK to here"; } sub do_main { my $self = shift; return "main - OK to here"; } 1; #### Content-Type: content-type #### $self->header_add( '-type' => 'text/plain' );