package Foobar_Super; use strict; use warnings; use base 'CGI::Application'; use CGI::Application::Plugin::FillInForm(qw/fill_form/); use CGI::Application::Plugin::Config::Simple; use CGI::Application::Plugin::Redirect; use CGI::Application::Plugin::Session; use CGI::Application::Plugin::DBH (qw/dbh_config dbh/); use HTML::Template; #--- Start CGI::APP sub cgiapp_init { my $self = shift; #--- Set Paths $self->config_file( '/opt/foobar/myapps/' . ucfirst $self->param('client') .'/conf/'. $self->param('client').'.conf');; $self->tmpl_path( '/var/www/' . $self->param('client') . '/templates ); #--- Session $self->session_config( DEFAULT_EXPIRY => '+8h'); #--- Contact to DB $self->dbh_config( $self->config_param('db.host'), $self->config_param('db.user'), $self->config_param('db.pass'), {RaiseError => 1} ); } 1;