in reply to Split process->check ->and run Parallel
I'm not really clear on what you want to do. The basic usage of fork is as follows:
if (my $child = fork()) { # in parent while (! -f "output.txt") { print "Waiting for output.txt\n"; sleep 10; }; print "Found output.txt, continuing\n"; } else { # In child, just run p2 exec 'p2'; # exit }; # do more stuff print "Waiting for child to finish\n"; wait $child;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Split process->check ->and run Parallel
by matrixmadhan (Beadle) on Dec 24, 2008 at 05:54 UTC |