in reply to How to capture process and redirect STDOUT in a hash
So one approach might be, for each process in your queue, save stdout and stderr to distinct files (using different names for each process), and then read those files back when the ssh->system calls are all done.
I expect you could also open file handles that write to in-memory scalar variables (see description of open(FH,'>',\$variable) in the man page for open), pass those file handles to ssh->system() as default stdout/stderr, and then just do regex matches on those variables when the processes are done.
I think you'll want to use two separate outputs for each process (separating stderr and stdout), because each output of each process might operate asynchronously, and if more than one stream goes to a single file handle, the data might get interleaved in ways you wouldn't expect or want (e.g. a stderr message in the middle of a stdout line).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to capture process and redirect STDOUT in a hash
by thanos1983 (Parson) on Jan 02, 2015 at 08:41 UTC | |
by graff (Chancellor) on Jan 02, 2015 at 18:17 UTC |