in reply to A Database Connection Question

From the fine documentation:

If the connect fails (see below), it returns undef and sets both $DBI::err and $DBI::errstr. (It does not explicitly set $!.) You should generally test the return status of connect and print $DBI::errstr if it has failed.

So, you can check the return value for undef and/or the class vars mentioned.