for (i=0; i<$counter; i++) { system("perl test1.pl &"); system("perl test2.pl"); #I want to continue with the next iteration when I am sure that background process is completed #How can I detect above condition? }