You are correct, depending on whether or not you want the rest of the script to continue. But rather than setting $dbh->{RaiseError} = 1 I usually prefer adding a {RaiseError => 1} argument to the connect, so that even connect errors are caught by RaiseError.