in reply to forking through a subroutine

Or, if you want to wait for the child to finish, rather than killing it off as the parent dies, then you can, rather than killing the children, use wait or waitpid, which are both documented in perlfunc.