Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
September 21, 2005, 2:32 pm
rate this thread
Re: newbie, what is the best way to include common settings.conf values
You may wish to look at the various modules listed under:
What I usually do is make a simple module that returns a hashref
containing config information. So for instance [example only and
dsn => 'dbi:driver:database',
user => 'user',
passwd => 'passwd'
my $conf = require MyConf;
my $dbh = DBI->connect(
$conf->, $conf->User, $conf->
) or die $DBI::errstr;
You'd need to read perlmod, and the perlfunc entries for use() and
Yeah, anytime you find you're making lots of scalar vars with
a common element to their name, you probably wanteded a hash.
my %sDbVars = map $ENV, qw/sDbSrv sDbName sDbUser sDbUserPw/;