scarus has asked for the wisdom of the Perl Monks concerning the following question:
------------------ sub Pooled_function { my($id,$parentfh) = @_; print $parentfh "start\n"; close(STDOUT); close(STDERR); while (1) { chomp(my $pclass = <$parentfh>); my $file = "$build_logs_dir/$pclass.log"; open(STDOUT, "> $file") or die "Can't redirect stdout: to $file " +; open(STDERR, ">&STDOUT"); # ----------- Do the stuff ------ close(STDOUT) or die "Can't close STDOUT: $!"; close(STDERR) or die "Can't close STDERR: $!"; print $parentfh "$id $pclass $result\n"; } close($parentfh); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: output of multiple processes
by moritz (Cardinal) on May 26, 2008 at 09:37 UTC | |
|
Re: output of multiple processes
by pc88mxer (Vicar) on May 26, 2008 at 16:19 UTC |