sub test1252 { my @jobs = (); foreach my $test_obj (@objects) { push @jobs, async { my $rc = test($test_obj); if ($rc ne 0) { print "Test Failed for $test_obj\n"; local $SIG{'KILL'} = sub {threads->exit();}; $_->kill('KILL')->join() for @jobs; exit $code_blue; } }; } $_->join for @jobs; }