package TestSite; use base 'CGI::Application'; use warnings; use strict; sub setup { my $self = shift; $self->start_mode('mode1'); $self->mode_param('rm'); $self->run_modes( 'mode1' => 'one', 'mode2' => 'two' ); } sub one { my $self = shift; my $template = $self->load_tmpl; return $template->output; } sub two { my $self = shift; my $q = $self->query(); my $template = $self->load_tmpl; $template->param(test_post => $q->param('test_post')); return $template->output; } 1; #### One

Page one

Input:

##
## Two

Page two

Value of "test_post" is .

Click to go back to one

##
## One

Page one

Input:

##
## #!/Perl/bin/perl use warnings; use strict; use CGI; use HTML::Template; my $q = new CGI; my $template = HTML::Template->new(filename => 'mode1a.html'); print "Content-Type: text/html\n\n", $template->output; #### #!/Perl/bin/perl use warnings; use strict; use CGI; use HTML::Template; my $q = new CGI; my $template = HTML::Template->new(filename => 'mode2a.html'); $template->param(test_post => $q->param('test_post')); print "Content-Type: text/html\n\n", $template->output; #### One

Page one

Input:

##
## Two

Page two

Value of "test_post" is .

Click to go back to one