in reply to Puzzling error in CGI:Application: "must call dbh_config() before calling dbh()"

I think the error message is misleading - you are setting up a DB handle but not the one you later request:

$self->dbh_config('subscriber', [$data_source, $self->config_param('mysql.username'), $self->config_param('mysql.password'), { RaiseError => 1 } ]);

... vs ...

$self->dbh('subscribers')

Consider using either a constant or global variable for the name of the database handle (subscriber vs. subscribers).

Replies are listed 'Best First'.
Re^2: Puzzling error in CGI:Application: "must call dbh_config() before calling dbh()"
by bradcathey (Prior) on Apr 30, 2023 at 13:36 UTC

    Duh, Brad. Thanks for the extra set of eyes on this.

    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot