our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
$VERSION = 1.00;
@ISA = qw(Exporter);
- @EXPORT = qw(db_connect db_commit www_begin
+ @EXPORT = qw(db_connect db_commit www_begin hquote
$dbh);
%EXPORT_TAGS = ( );
@EXPORT_OK = qw();
$r->header_out("Cache-Control: no-cache");
}
+sub hquote ($) {
+ my ($raw) = @_;
+ return pack "H*", $raw;
+}
+
sub db_connect () {
my $dbf;
foreach my $d (@INC) {
- $dbf = "$d/away.db";
+ $dbf = "$d/data/away.db";
if (stat $dbf) {
chdir($d) or die $!;
last;
}
}
- $dbh = DBI->connect("dbi:SQLite:away.db",
+ $dbh = DBI->connect("dbi:SQLite:$dbf",'','',
{ AutoCommit=>0,
RaiseError=>1, ShowErrorStatement=>1
})