chiark / gitweb /
wip
[nj-awaymsg.git] / AwayMsg.pm
index 468e9f072b15005c7658dc1009bea3d126a2dea9..9fdf742ed366720ed91c562abfdf0d14d10143d9 100644 (file)
@@ -1,25 +1,29 @@
-module AwayMsg;
 
 package AwayMsg;
+
 use strict;
 use warnings;
 
+use DBI;
+
 BEGIN {
     use Exporter ();
     our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
     $VERSION     = 1.00;
     @ISA         = qw(Exporter);
-    @EXPORT      = qw(&db_connect $dhb);
+    @EXPORT      = qw(&db_connect $dbh);
     %EXPORT_TAGS = ( );
     @EXPORT_OK   = qw();
 }
 
+our ($dbh);
+
 sub db_connect () {
     my $h = DBI->connect("dbi:SQLite:away.db",
                         { AutoCommit=>0,
                           RaiseError=>1, ShowErrorStatement=>1
                         })
-        or die "$DBI:errstr ?";
+        or die "$DBI::errstr ?";
 
     $dbh->do("BEGIN");
 
@@ -46,3 +50,5 @@ sub db_connect () {
 
     return $h;
 }
+
+1;