foreach (@go_do_something){ my $thr = threads->new(\&some_sub,$_); $thr -> detach(); } #### foreach (@go_do_something){ $used_threads++; @thr_ll[$used_threads] = threads -> new(\&some_sub,$_); @thr_ll[$used_threads] -> detach(); }