in reply to Re: Perl $dbh->prepare failed
in thread Perl $dbh->prepare failed

The database handler is again created in the second script. The connection is alive till the error occurs.