in reply to Parent process finished. How to exit the child process.

Just use ReadKey in timed mode:

#! perl -slw use strict; use Term::ReadKey; ReadMode 4; my( $count, $c ); until( defined( $c = ReadKey( 1 ) ) ) { print ++$count; } ReadMode 0;

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy