in reply to Re^3: Peculiar Behaviour with DBI and MySQL
in thread Peculiar Behaviour with DBI and MySQL

Seems to me that there is a $dbh->disconnect missing, so either add the disconnect inside the loop, or do what gellyfish says, and then add a disconnect outside the loop.