As far as I can tell, the bash wait command waits for a logical "AND" of all the child processes.
Assuming I am coding in C:
(1) What is the function I would use to create multiple bash child process running perl?
(2) What is the function I would use to reinvent the bash wait command so I could wait for a logical "OR" so my parent wakes up when the first child process dies?
The wait syscall will return for each of the children seperately, so you will have to issue the call as many times as there are children. Alternately, you could look into signal handling as the parent process receives a SIGCHLD when one of the children terminate.
Your code can have all the children executing in parallel. Write it such that the main parent process will fork children till there are no more left to fork, and then start wait()ing. The execution of the children will be parellel in this case, but the parent process will issue the waits in a serial manner.