in reply to How do I keep script live and not abort on fail to connect
if (my $dbh1 = DBI->connect("DBI:mysql:database=$row[0]:host=xxxxx",$d +b_user,$db_pass,{RaiseError=>1})) { print "SUCCESS\n"; push (@book_database_urls, $row[0]); }
As you've explicitly set RaiseError ({RaiseError=>1}), the connect will die in case of an error, instead of just returning error codes (i.e. undef in this case). So, either leave RaiseError at its default value "off", or catch the exception by wrapping the connect call in an eval {...} (see die).
|
|---|