package TestApp; use warnings; use strict; use base qw( CGI::Application ); sub setup { my $self = shift; $self->start_mode('welcome'); $self->run_modes( 'welcome' => \&welcome_mode, 'hello' => \&hello_mode, 'whoopee' => \&whoopee_mode, ); } ################################################################ # # run modes # ################################################################# sub welcome_mode { my $self = shift; my $content = < Welcome Home is where.... EOC return $content; } sub hello_mode { my $self = shift; my $content = < Hello Hello world! Whoopee Whoopee_dispatch EOC return $content; } sub whoopee_mode { my $content = < Whoopee Whoopee! EOC return $content; } 1;