in reply to how to make child process die after parent exists in perl

Doing that reliably is far from easy but there are several alternatives:

Lock some file or semaphore on the parent and on every child process use a thread to wait until the lock is released. Then kill the child process from the thread.

Allocate a new pty (IO::Pty) and set it as the children tty. Once the parent exits, children get a SIGHUP.

On the children processes monitor the parent pid (getppid()). When it becomes 1 it means that the parent has exited. Though, for that to work you will have to use fork+exec to spawn the children instead of system("... &") in order to avoid the intermediate shell process.