This is what I have so far:
Create a file called config.pl . Place it in a place accessible to all scripts, reducing the resolution to the minimum minimum required to read all scripts.
According to this perlmonks manual :
Make the contents of config.pl a hash:
dbserver => 'localhost', db => 'mydatabase', user => 'username', password => 'mysecretpassword',
Then in each script:
use strict; # The old way.... #my $dbh = DBI->connect("DBI:mysql:database=mydatabase;host=localhost", "username", "mysecretpassword"); # The new way my %config = do '/path/to/config.pl'; my $dbh = DBI->connect("DBI:mysql:database=".$config{db}.";host=".$config{dbserver}."", $config{user}, $config{password});
source share