Looks OK. Would help if you can post your test data file. (UPDATE: I see the file. But It looks like each section is a record, not a table.)
You should always use placeholders in your calls to DBI.
my $sql;
foreach my $table (sort keys %$config) {
my $sql = qq{ insert into $table ( id, balance ) values ( ?, ? ) };
my $sth = $dbh->prepare( $sql );
while (my ($col, $val) = each %{$config->{$table}}) {
$sth->execute( $col, $val );
}
}
Remember: Ne dederis in spiritu molere illegitimi!
|