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")

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.