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);