chiark / gitweb /
CommodsDatabase: In db_connect_core, break out $opts into a variable
[ypp-sc-tools.web-live.git] / yarrg / CommodsDatabase.pm
index f704f1241b90495b05eb120066bc52259b403030..0d491c43887318e1e66b170270aa422eb2c8dd5c 100644 (file)
@@ -64,10 +64,10 @@ sub dbr_connect ($$) {
 
 sub db_connect_core ($) {
     my ($fn)= @_;
-    my $h= DBI->connect("dbi:SQLite:$fn",'','',
-                      { AutoCommit=>0,
-                        RaiseError=>1, ShowErrorStatement=>1,
-                        sqlite_unicode=>1 })
+    my $opts = { AutoCommit=>0,
+                RaiseError=>1, ShowErrorStatement=>1,
+                sqlite_unicode=>1 };
+    my $h= DBI->connect("dbi:SQLite:$fn",'','',$opts)
        or die "$fn $DBI::errstr ?";
     return $h;
     # default timeout is 30s which is plenty