my @threads = (); $SIG{'TERM'} = sub { foreach(@threads){ $_->join(); } }; push @threads, threads->create(proc1); push @threads, threads->create(proc2);