in reply to fork child process

Your forked children continue the loop. Most likely, you don't want to do that. Either use exit when your child completed its work or use a wrapper like Parallel::ForkManager, which provides idioms that make working with forked children easier.