in reply to Re: DBI issue
in thread DBI issue
my $dbh = DBI->connect(....) or die $DBI::errstr;
Another option for handling of DBI errors is usage of exceptions. DBI->connect has option RaiseError which can enable thowing exceptions if there exist any problem.
In former case you don't need to check what DBI->connect returns. Instead you should put this code inside eval block if you want to handle errors.my $dbh = DBI->connect($dsn, $user, $password, { RaiseError => 1 });
|
|---|