#!/usr/bin/perl use DBI; use strict; my $app = self->new( TMPL_PATH => "../templates/", PARAMS => { 'dbh' => DBI->connect( "DBI:mysql:database=apex;host=localhost", undef, undef ), 'mode_param' => "stage" } ); $app->run; exit 0; package self; use base qw/CGI::Application/; use strict; sub setup { my $self = shift; $self->start_mode('display'); $self->run_modes({ 'AUTOLOAD' => 'display_calendar' }); $self->mode_param($self->param('mode_param')); }; sub teardown { my $self = shift; $self->param('dbh')->disconnect; }; . . . 1; __END__