Yes, $dbh->ping is a good way to check if a connection is still live.
In reply to Re^2: Issue with dbi connect_cached method by Corion in thread Issue with dbi connect_cached method by Anonymous Monk