Die Fehlerbehandlung ist ziemlich unguenstig. So kann nichts im Error-Log landen.
$dbh = DBI->connect("DBI:$db_typ:$db_name:$hostname:$port", "root", "passwort");
my $dbh = DBI->connect ... or die "can't connect: $DBI::errstr";
print "Fehler: $DBI::errstr";
if ($DBI::errstr ne "") {die}
Das taugt dagegen nichts.
$sth = $dbh->prepare(<<SLCT);
my $sth = $dbh->prepare(<<SLCT) or die "can't prepare!";
SELECT * FROM mitarbeiter
SLCT
$sth->execute;
$sth->execute or die "can't execute: ". $sth->errstr;
Peter