in reply to DBI database connection support and more

The easiest way I've found is to use an environment variable to name the application-specific configuration file.

So, for our credit card payment processing system, the config file lives in an environment variable called MERCHANT_CONFIG_FILE, which might then contain:

[Database] username = bradb password = god hostname = foo database = bar
Then parse it with something like Config::IniFiles and you're good to go. Of course, this can be applied to more than just database connections.

Replies are listed 'Best First'.
Re: Re: DBI database connection support and more
by DapperDan (Pilgrim) on Sep 21, 2003 at 16:06 UTC
    I find that this technique works well with a system for which you have multiple deployments, because it keeps hardcoded information specific to the deployment out of CVS. (Of course it shouldn't be hard-coded in the first place but I digress).

    For a CGI system under Apache you can just use a SetEnv directive in your httpd.conf to set MERCHANT_CONFIG_FILE and you're set; unless your httpd.conf is in CVS of course. :)