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

It is almost certainly some limit on the number of connections that you have to the database - I think you will find that if you move the :

my $dsn = 'DBI:mysql:*database*:localhost'; my $db_user_name = '*username*'; my $db_password = '*password*'; my $dbh = DBI->connect($dsn, $db_user_name, $db_password);
outside the foreach loop then all your troubles will go away.

/J\