#! /usr/bin/perl
use strict;
use warnings;
use DBI;
package nms;

BEGIN {
	require "config.pm";
	eval {
		require "config.local.pm";
	};
}

sub db_connect {
	my $dbh = DBI->connect("dbi:Pg:" .
				"dbname=" . $nms::config::db_name .
				";host=" . $nms::config::db_host,
				$nms::config::db_username,
				$nms::config::db_password)
	        or die "Couldn't connect to database";
	return $dbh;	
}

1;
