chiark / gitweb /
wip login/logout handling
[nj-awaymsg.git] / AwayMsg.pm
index acfb0ce..72c5946 100644 (file)
@@ -31,14 +31,7 @@ sub hquote ($) {
 }
 
 sub db_connect () {
-    my $dbf;
-    foreach my $d (@INC) {
-       $dbf = "$d/data/away.db";
-       if (stat $dbf) {
-           chdir($d) or die $!;
-           last;
-       }
-    }
+    my $dbf = "$ENV{'NJAWAYMSG'}/data/away.db";
     $dbh = DBI->connect("dbi:SQLite:$dbf",'','',
                         { AutoCommit=>0,
                           RaiseError=>1, ShowErrorStatement=>1