http://qs321.pair.com?node_id=1030543


in reply to DB Connection using CGI::Application

You need to be using CGI::Application::Plugin::DBH, if you're not already, then do something like this:

sub cgiapp_init { my $self = shift; ... $self->dbh_config('mydbh', [$dsn1, $user1, $pass1, \%options1,]); $self->dbh_config('mydbh400', [$dsn2, $user2, $pass2, \%options2,]); } sub one { my $self = shift; my $dbh = $self->dbh('mydbh'); ... } sub two { my $self = shift; my $dbh = $self->dbh('mydbh400'); ... }

Replies are listed 'Best First'.
Re^2: DB Connection using CGI::Application
by Anonymous Monk on Apr 25, 2013 at 03:41 UTC

    You need to be using ...

    param will work, plugins aren't mandatory