package App::Index; use strict; use warnings; sub new { my($class,$self)=(shift,{@_}); bless($self,$class); $self; } sub pre_run { print "Content-Type: text/html;charset=Shift_JIS\n\n"; } sub error_mode { } sub teardown { } sub setup { my $self = shift; my $mode = shift; my %run_mode = ( 'index' => 'do_index', 'next' => 'do_next', 'back' => 'do_index', ); return $run_mode{$mode}; } sub inner_method { return "This is inner method!!"; } sub do_index { my $self = shift; my $ret_val = $self->inner_method; return <<"__HTML__"; Index page

Index Page

Next page

$ret_val

__HTML__ } sub do_next { my $self = shift; return <<"__HTML__"; Next page

Next Page

Back page __HTML__ } 1;