in reply to Perl wait vs Unix ksh wait

But, if you are "stuck" on Unix (which is really a good thing), you can refer to this node (or many others if you search for fork, exec and wait). Basically, you will fork off each independent process, collecting their process ids and then have the parent script wait until it receives a SIGCHLD from each one signaling it has finished.

---
echo S 1 [ Y V U | perl -ane 'print reverse map { $_ = chr(ord($_)-1) } @F;'

Replies are listed 'Best First'.
Re^2: Perl wait vs Unix ksh wait (oops)
by tye (Sage) on Oct 31, 2007 at 18:57 UTC

    The node you linked to doesn't properly handle fork failing. That is typical.

    See my reply in this thread for a solution that does handle fork failing and for more information about how it still isn't as nice as system(1,...).

    - tye