D
David Resnick
I need to execute multiple simultaneous system() statements. I
originally did this using perl threads each invoking a system cmd,
waiting for them to be joinable, then harvesting the return status
with join(). The system commands are well behaved in that they will
finish eventually (have built in time limits). Unfortunately, I
discovered that the perl I need to use on some of our systems was
built without threads and replacing it isn't an option.
Is there a nice way to do this AND get the return values of the
processes launched in single threaded perl? Repeated system("$cmd &")
would execute all the processes, but I would need some way to get the
return status. Fork and exec would also work, but same issue. I
could run a wrapper that calls system and writes the result to a file
I guess, but that feels clunky. Any suggestions that seem nicer?
originally did this using perl threads each invoking a system cmd,
waiting for them to be joinable, then harvesting the return status
with join(). The system commands are well behaved in that they will
finish eventually (have built in time limits). Unfortunately, I
discovered that the perl I need to use on some of our systems was
built without threads and replacing it isn't an option.
Is there a nice way to do this AND get the return values of the
processes launched in single threaded perl? Repeated system("$cmd &")
would execute all the processes, but I would need some way to get the
return status. Fork and exec would also work, but same issue. I
could run a wrapper that calls system and writes the result to a file
I guess, but that feels clunky. Any suggestions that seem nicer?