my $sth=$dbh->prepare($MYSQL) or die "Could not prepare $MYSQL: $DBI::errstr\n"; ...etc. for all connects, executes, etc.