Never mind! As it turns out, $dbh was defined in global space above the function that occasionally did the connect(). I do it that way so that I can have an END block that explicitly disconnects. I needed to disconnect at the end of the function.
Gee, I wonder how many other places I've done that...