Last change
on this file since 221 was
221,
checked in by Dominic Hargreaves, 14 years ago
|
More modularisation
|
File size:
388 bytes
|
Line | |
---|
1 | package NPEMap; |
---|
2 | |
---|
3 | use vars qw(@ISA @EXPORT); |
---|
4 | use warnings; |
---|
5 | use strict; |
---|
6 | |
---|
7 | use vars qw($dbname $dbhost $dbuser $dbpass); |
---|
8 | |
---|
9 | use NPEMap::Config; |
---|
10 | |
---|
11 | require Exporter; |
---|
12 | @ISA = qw(Exporter); |
---|
13 | @EXPORT = qw(setup_dbh); |
---|
14 | |
---|
15 | sub setup_dbh { |
---|
16 | my $data_source = "dbi:Pg:dbname=$dbname"; |
---|
17 | $data_source .= ";host=$dbhost" if $dbhost; |
---|
18 | return DBI->connect_cached($data_source, $dbuser, $dbpass); |
---|
19 | } |
---|
20 | |
---|
21 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.