home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!mcsun!sun4nl!alchemy!ruunfs!ruunfs.fys.ruu.nl!muts
- From: muts@fysap.fys.ruu.nl (Peter Mutsaers)
- Subject: Re: Simultaneous processes
- In-Reply-To: peter@merlin.acadiau.ca's message of 26 Aug 92 14:20:21 GMT
- Message-ID: <MUTS.92Aug27171737@ruunfs.fys.ruu.nl>
- Sender: usenet@fys.ruu.nl (News Control)
- Organization: Rijks Universiteit Utrecht
- References: <root.714838821@merlin>
- Date: Thu, 27 Aug 1992 15:17:40 GMT
- Lines: 24
-
- >>On 26 Aug 92 14:20:21 GMT, peter@merlin.acadiau.ca (Peter Steele) said:
-
- Peter> How does one set up simultaneous processes in perl? For example,
- Peter> how would I translate the following into perl:
-
- Peter> #!/bin/sh
-
- Peter> ls -la > d1 &
- Peter> ls -la > d2 &
- Peter> ls -la > d3 &
- Peter> wait
- Peter> cat d1 d2 d3 > d4
-
- Use fork+exec to spawn, and wait to wait, something like this:
- fork() || (exec "ls -la > d1");
- fork() || (exec "ls -la > d2");
- fork() || (exec "ls -la > d3");
- wait; wait; wait; # if there are exactly 3 childs
-
- etc
- --
- _________________________________________________________________________
- Peter Mutsaers. |================================================
- muts@fys.ruu.nl | Memento Mori
-