perl_virgin has asked for the wisdom of the Perl Monks concerning the following question:
foreach $datdir (@dates) { $fullpath = (join ('',$ypath, $datdir)); $fulltmp = (join ('', $ytmp, $datdir)); my $pid = fork(); if ($pid == 0) { $what = `rsh $yte ls -ld $fullpath`; if ($what =~/\S/) { $what2 = `rsh $yte mkdir -p $fulltmp`; if ($what2 !~/\S/) { exit 1; } } exit 0; } $paths{$pid} = $fullpath; $njobs++; while ($njobs >= $maxnjobs) { $waitpid = wait(); if ($?) { push(@vdates, $paths{$waitpid}); } $njobs--; } } while ($njobs > 0) { $waitpid = wait(); if ($?) { push(@vdates, $paths{$waitpid}); } $njobs--; } my @sorteddates = sort(@vdates); return(@sorteddates);
Edit kudra, 2002-05-01 Added 'forking' info to title per ntc request
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SOS
by virtualsue (Vicar) on Apr 28, 2002 at 10:27 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |