I\'m doing a bunch of system calls that I want to run in parallel:
system(\" sleep 5 && echo step 1 done &\");
system(\" sleep 3 && echo
Fork a child process to perform each job, and in the parent, wait for those processes to finish before exiting.
See perldoc perlfork, perldoc -f fork and perldoc -f waitpid.
(The exact code for this is left as an exercise for the reader -- everyone should have to write this from scratch at least once, to understand the details involved. There are lots of examples on this site as well.)