removing inheritance from matrix mapping tables
[migration-tools.git] / text / csv2sql
index 39ce2d2..9ee8203 100755 (executable)
@@ -14,12 +14,12 @@ my $cfg;
 my $csv_config;
 
 sub init {
-       our %config;
-       do '/openils/conf/offline-config.pl';
     if ($PGHOST and $PGPORT and $PGUSER and $PGDATABASE) 
     {
-        $db = connect_db($PGDATABASE,$PGUSER,undef,$PGHOST) or die $DBI::errstr;
+        $dbh = connect_db($PGDATABASE,$PGUSER,undef,$PGHOST) or die $DBI::errstr;
     } else {
+        our %config;
+        do '/openils/conf/offline-config.pl';
         $dbh = DBI->connect( $config{dsn}, $config{usr}, $config{pw} ) or die $DBI::errstr;
     }