By default MySQL will *do the right thing* very slowly. It will actually close an inactive connection after 8 hours. Given that by default there are only 100 connections available it is quite easy to use them all up if you do not do a clean disconnect. You set the values in my.cnf BTW.
[mysqld]
set-variable=wait_timeout=28800
set-variable=max_connections=100
Cleanup is simple. All you need is an END block, ideally placed immediately after the connect (so you know it is there).
my $dbh = DBI->connect......
END{ $dbh->disconnect() if $dbh }
|