# bad, you are only joining 1 # $thr->join; # $thr1->join; #better foreach my $thread ( threads->list ) { $thread->join; } # or you could stuuff the threads into hashes # like my %thrs; for(1..30){ $thrs{$_}{'thread'} = threads->new(\&thread_sub); } #then join them by looping thru the hash keys