in reply to Re: (tye)Re: Dealing with timeouts using the Shell module
in thread Dealing with timeouts using the Shell module

You can use Net::Ping to more quickly decide that a machine is not available before trying to connect.

Beyond that, you'll need (because the operating system does not provide an asynchronous method for connecting to these resources) separate threads or separate processes, which, when using Perl, means you need separate processes. And since fork emulation for Win32 Perl still sucks, I think the best choice is currently Win32::Process.

I'd throw together a quick example of how to do this but I don't have the time at the moment and, unfortunately, I don't think there is a really simple way to do this. The simplest-to-code way is probably to blindly create a new process for each machine and have each append to an output file and then read the results from there after all of the children finish. For a large list of computers, that probably won't work, however.

I think you could find a module to manage a group of slave processes for you, and that might be a good way to go. Sorry, I can find one quickly at the moment.

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re: Dealing with timeouts using the Shell module