my $sth = $dbh->prepare("INSERT INTO $table ($cols) VALUES (?,?,?)") or die "$dbh->errstr"; my @array=('one', 'two', 'thee'); $sth->execute(@array) or die "$dbh->errstr : $table";