sub worker { while(1){ if(($ftp_status eq "aktiv") || ($log_status eq "aktiv")){ my @thrs; foreach my $object (@Liste){ #Überprüfe, ob die letzte Durchführng abgeschlossen ist if(!$arr_ablauf[$object->getID()]){ $arr_ablauf[$object->getID()] =1; push @thrs, threads->create(\&ablauf, $object); } } $_ -> join for @thrs; print "joined\n"; } sleep 10; } }