package MyApp; use base 'CGI::Application'; use CGI::Application::Plugin::Session; use CGI::Application::Plugin::AutoRunmode; sub setup { my $self = shift; $self->start_mode('home'); } # this method is a "runmode" a "screen view" if you will sub home : Runmode { my $self = shift; $self->have_basic_info or return $self->forward('basic_info'); ... } sub basic_info : Runmode { my $self = shift; return q{
name: ... }; } sub _basic_info_save : Runmode { my $self = shift; $self->query->param('name') or die('missing name'); $self->session->param('name' => $self->query->param('name') ); ... } # this method is not a runmode : sub have_basic_info { my $self = shift; # LOOK: you don't worry about instancing the session object, about making # sure who it's for, etc etc-- you just freaking call self->session() # and your object is there- cookies set.. the works- all for you! $self->session->param('name') ? 1 : 0; }