my @pids; my $pid; if ($pid = fork()) { # Parent process push(@pids, $pid); } else { # Child process exec('md5', $IdocFileName, $IdocMd5FileName); exit; # This should never be reached. } ... # Clean up the children later... foreach $pid (@pids) { waitpid($pid); }