package MyApp::Small; use base 'CGI::Application'; #use CGI::Application::Plugin::Apache qw(:all); # Note#3 use strict; use Apache2::RequestRec (); use Apache2::RequestIO (); use Apache2::RequestUtil (); #use CGI::Application::Plugin::Session; # Note#1 #use CGI::Application::Plugin::Authentication; # Note#2 use Apache2::Const -compile => qw(OK); sub handler : method { my ($pkg, $r) = @_; my $self = $pkg->new(); $self->run(); return Apache2::Const::OK; } sub setup { my $self = shift; $self->start_mode('mode1'); $self->run_modes( 'mode1' => 'mode1', 'mode2' => 'mode2', ); } sub mode1 { my $self = shift; my $output = "
This is page 1.\n"; return $output; } sub mode2 { my $self = shift; my $output = "
This is page 2.\n"; return $output; } 1;