use strict; use warnings; use DBI; my $dbh = DBI->connect('dbi:Oracle:xxxReal_databasename', 'xxxReal_user', 'bad_pasword', { PrintError => 0, RaiseError => 1, }); print "Got Here\n"; $dbh->disconnect(); OUTPUT: > ./tst DBI connect('XXXXX','XXXXX',...) failed: ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin) at ./tst line 8 #### use strict; use warnings; use DBI; my $dbh = DBI->connect('dbi:Oracle:xxxReal_databasename', 'xxxReal_user', 'bad_pasword', { PrintError => 0, RaizeError => 1, }); print "Got Here\n"; $dbh->disconnect(); OUTPUT: > ./tst Got Here Can't call method "disconnect" on an undefined value at ./tst line 16.