SPUG: Best practice? DBI connection parameters *not* in Perl code

Michael R. Wolf MichaelRWolf at att.net
Thu Apr 8 10:45:05 PDT 2010

As some DBI-based code is being ported to other machines, I'm having  
to pass command-line parameters to too many administrative and test  
programs.  I'd like to change this *once* external to *all* programs  
and have it apply to them all.  This will have the added benefit of  
articulating a cleaner differentiation between environments  
(development, test, production).

What's more popular to do this?
  - environment variables
  - config file

In code, and in *theory*, it's a trivial difference...

     $db_user = $ENV{db_user} || 'root';
     $db_user = $some_config_ref->get_attribute('db_user') || 'root';

I'm more interested in how this works in *practice*.  That is, when  
fielded, which seems to be groked by more end users?  And if the  
answer is 'config', which of the 2 score and twenty config modules  
seems to be groked by more end users?


Michael R. Wolf
     All mammals learn by playing!
         MichaelRWolf at att.net

More information about the spug-list mailing list