in reply to fork report child finish by order child process finish.

Unless you are training yourself, it should be easier to use Parallel::ForkManager and its run_on_finish callback.

Manual way to do this is sequentially running waitpid with WHOHANG flag and checking its return value for all pids running. Example (untested):

foreach my $process (@child_pids) { if (waitpid($process->{PID}, WNOHANG)) { print "Process $process->{PROCESS} terminated\n"; } }

Sorry if my advice was wrong.