source: trunk/npemap.org.uk/perllib/NPEMap.pm @ 221

Last change on this file since 221 was 221, checked in by Dominic Hargreaves, 14 years ago

More modularisation

File size: 388 bytes
Line 
1package NPEMap;
2
3use vars qw(@ISA @EXPORT);
4use warnings;
5use strict;
6
7use vars qw($dbname $dbhost $dbuser $dbpass);
8
9use NPEMap::Config;
10
11require Exporter;
12@ISA    = qw(Exporter);
13@EXPORT = qw(setup_dbh);
14
15sub 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
211;
Note: See TracBrowser for help on using the repository browser.