in reply to how to fork?

Sounds like a job for Parallel::ForkManager. See Waiting.. and any number of nodes you can gleam from a Super Search where others have asked similar questions.