do file no longer sees lexicals
[migration-tools.git] / text / csv2sql
index 9ee8203..2d74d0a 100755 (executable)
@@ -19,7 +19,7 @@ sub init {
         $dbh = connect_db($PGDATABASE,$PGUSER,undef,$PGHOST) or die $DBI::errstr;
     } else {
         our %config;
-        do '/openils/conf/offline-config.pl';
+        eval `cat /openils/conf/offline-config.pl`;
         $dbh = DBI->connect( $config{dsn}, $config{usr}, $config{pw} ) or die $DBI::errstr;
     }
 
@@ -52,7 +52,7 @@ sub init {
                die "$csv_config does not exist\n";
        }
        if ($csv_config && -e $csv_config) {
-               do $csv_config;
+               eval `cat $csv_config`;
        }
        if (! -e $ARGV[0]) {
                die "$ARGV[0] does not exist\n";