]> git.sesse.net Git - autoeconomy/blob - autoeconomy.pm
Initial checkin for move to Git (no prior version history available).
[autoeconomy] / autoeconomy.pm
1 #! /usr/bin/perl
2 use DBI;
3 require './config.pm';
4 package autoeconomy;
5
6 sub db_connect {
7         my $dbh = DBI->connect("dbi:Pg:" .
8                 "dbname=" . $autoeconomy::config::dbname . ";" .
9                 "host=" . $autoeconomy::config::dbhost,
10                 $autoeconomy::config::dbuser,
11                 $autoeconomy::config::dbpass)
12                 or die "Couldn't connect to database: " . DBI::errstr();
13         $dbh->{RaiseError} = 1;
14         return $dbh;
15 }
16
17 1;