12 our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
15 @EXPORT = qw(db_connect db_commit expires2timet
25 foreach my $d (@INC) {
32 $dbh = DBI->connect("dbi:SQLite:away.db",
34 RaiseError=>1, ShowErrorStatement=>1
36 or die "$DBI::errstr ?";
41 my $sth= $dbh->prepare($stmt);
44 if ($row= $sth->fetchrow_hashref()) {
45 die("REFERENTIAL INTEGRITY ERROR\n".
46 "\n$stmt\n". Dumper($row),"\n");
50 sub expires2timet ($) {
55 open F, "-|", qw(date -d),'$str',qw(+%s) or die $!;
57 $?=0; $!=0; close F or die "$? $!";
58 $dtime =~ m/^\d+$/ or die "$dtime ?";
63 nooutput("SELECT * FROM addresses LEFT JOIN config".
64 " USING (emailaddr) WHERE forwardfile IS NULL");
65 nooutput("SELECT * FROM addresses LEFT JOIN texts".
66 " USING (textid) WHERE name IS NULL");