in reply to How to check the $dbh's status

If the ping method is not available, you could try something like this:
my $sth = $dbh->prepare('SELECT * FROM dual'); my $rows = $sth->execute(); if ($rows != 1) { # try to reconnect }
Selecting from dual always retrieves a single record. Caveat: I use Oracle. I'm not sure if dual is implemented on other database engines. --Akoya