my $pid = "$pid$_"; do{ $pid = spawn 'perl Start.pl' or die "spawn: $!"; print "************ PID NUMBER IS: $pid Starting\n"; my $num_proc = @pids; while ($num_proc) { for ( my $i=0; $i< @pids; $i++) { waitpid($pids[$i],0); print " PID $pids[$i] has exited \n"; $num_proc --; } } } until waitpid($pids,0);