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'); ... }