chiark / gitweb /
Fix some warnings
[ypp-sc-tools.db-live.git] / yarrg / web / pirates
old mode 100644 (file)
new mode 100755 (executable)
index 5378cf4..6a3c478
@@ -21,19 +21,6 @@ $sth->execute();
 <input type=submit name=submit value="Go">
 </form>
 
-
-use DBI;
-
-our $dbh;
-our $dbfn;
-$dbfn= "/home/ijackson/things/ypp-sc-tools.pctb-dict-test/yarrg/OCEAN-Midnight.db";
-    $dbh=DBI->connect("dbi:SQLite:$dbfn",'','',
-                       { AutoCommit=>0,
-                         RaiseError=>1, ShowErrorStatement=>1,
-                         unicode=>1 })
-        or die "$dbfn $DBI::errstr ?";
-    # default timeout is 30s which is plenty
-
 my $sth=$dbh->prepare(
     "SELECT a.commodname,b.price,c.price,d.stallname,e.islandname
      FROM commods as a
@@ -64,3 +51,8 @@ $sth->execute();
 
 </BODY>
 </HTML>
+
+<%init>
+use CommodsWeb;
+my $dbh= dbw_connect('Midnight');
+</%init>