use base 'CGI::Application'; use CGI::Application::Plugin::DBH (qw/dbh_config dbh/); sub cgiapp_init { my $self = shift; # connect to dssubscriber DB $self->config_file('/usr/home/[somepath]/conf/subscriber.conf'); # config_file is a C::A::P::C::S method my $data_source = sprintf 'DBI:mysql:database=%s;host=%s', $self->config_param('mysql.database'), $self->config_param('mysql.host'); $self->dbh_config('subscriber', [$data_source, $self->config_param('mysql.username'), $self->config_param('mysql.password'), { RaiseError => 1 } ]); }