http://www.perlmonks.org?node_id=1155367


in reply to error handling with dbi

You are calling undef() on your DB handle, rather than testing to see if it's defined.

Try changing:

if ( undef $dbh ) {
to:
if ( not defined $dbh ) {
Hope this helps!


The way forward always starts with a minimal test.