in reply to Re: DBI issue
in thread DBI issue

I want to add that if you were checked what returns DBI->connect then the reason of this problem would be obvious to you. Something like:
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.

my $dbh = DBI->connect($dsn, $user, $password, { RaiseError => 1 });
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.