Help for this page
my $stmt = qq/INSERT INTO books ( / . join(',', keys %hash) . qq/) VALUES (/ . join(',', ('?') x keys %hash) . qq/)/; my $sth = $dbh->prepare($stmt); $sth->execute(values %hash);
sub write_to_db { my $table = shift; #pass in table name ... $sth->execute(values %hash); } }