use DBI; while (1) { my $dbh = DBI->connect(); # Parent connecting # .. get a job list .. $dbh->disconnect(); # <-- NB! foreach my $job (@jobs) { my $pid = fork(); if (defined $pid) { if ($pid) { $children{$pid} = time; # This is the parent } else { child($job); # This is the child process } } else { logmsg "fork() failed: $!\n"; } } sleep 1; } sub child { my $job = shift; my $dbh = DBI->connect(); # Child connecting # .. do the job .. $dbh->disconnect(); exit; } #### DBD::mysql::dr connect failed: handle 1 is owned by thread 183f3e8 not current thread 260eb64 (handles can't be shared between threads and your driver may need a CLONE method added) at C:/PERL/site/lib/DBI.pm line 598. DBD::mysql::dr disconnect_all failed: handle 1 is owned by thread 183f3e8 not current thread 260eb64 (handles can't be shared between threads and your driver may need a CLONE method added) at C:/PERL/site/lib/DBI.pm line 677. END failed--call queue aborted.