if (!$dbh) { die "no db connection!"; } else { $dbh->run_some_command(); }