foreach(1..10) { system("$cmd &"); #... somehow to get pid of this system() call, $pid print "$cmd submitted with PID: $pid\n"; }