#!/usr/bin/perl use strict; use warnings; use DBI; my $dbh = DBI->connect("DBI:mysql:dbname:localhost",'user','passwd') or die $DBI::errstr; my $statement = "INSERT INTO test_tabelle(testfeld) VALUES (?)"; my $sth = $dbh->prepare($statement) or die $dbh->errstr(); $sth->execute(1) or die $dbh->errstr(); $sth->execute(undef) or die $dbh->errstr(); $sth->finish(); $dbh->disconnect();