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