package Testing; use base 'CGI::Application'; use strict; use warnings; use diagnostics; sub setup { my $self = shift; $self->start_mode('cast'); $self->mode_param('rm'); $self->tmpl_path('/home/users/rich36'); $self->run_modes( 'cast' => 'castVotes', 'list' => 'listVotes' ); #$self->param('badcomments' => ""); # ??? #$self->param('goodcomments' => ""); # ??? } sub castVotes() { my $self = shift; # Get the CGI query object my $q = $self->query(); # Set the params - these are the ones I'm trying to get to in the other run mode... $self->param( 'name' => $q->param('name'), 'id' => $q->param('id'), 'ip' => $q->param('ip'), ); # Code to validate values passed by the query string #.... # Returns HTML::Template output return $output; } sub listVotes() { my $self = shift; # Get the CGI query object my $q = $self->query(); # This doesn't work.... # I need to be able to access the values stored in # $self in the other run mode. my $name = $self->param('name'); my $id = $self->param('id'); my $ip = $self->param('ip'); } 1;