http://www.perlmonks.org?node_id=787538

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

In Cgiapp_init I have several DBs defined like
$self->dbh_config('Server1', [ $self->cfg('dsn'), $self->cfg('dbuser'), $self->cfg('dbpass') ] );
when I try
$dbh = $self->dbh($dbName);
where $dbName is 'Server1', it shows the error
must call dbh_config() before calling dbh().
How can I use a variable here to determine databases?