sub setup { my ($self) = shift; $self->mode_param('stage'); $self->run_modes({ '1' => \&display_form, '2' => 'display_results', }); $self->start_mode('1'); # Create DBI connection handle and make accessible to all run-modes via CGI::Application param() method # $self->param('dbh' => DBI->connect()); };