As the Anonymous Monk suggested, you may be able to speed this up by processing the hosts in parallel. Another option, in addition to those suggested, may be Parallel::ForkManager.

I did not look at your code (thus, the "may be" above). For future posts, please post your code in the post itself (surrounded by <code></code> tags, and possibly <readmore></readmore> tags if very lengthy)-besides being more convenient to those who may have only a limited time to consider your post when they first see it, it also helps to preserve the context for answers that may be posted (as, if memory serves, most PasteBin sites expire the code after some time, thus removing the context for readers who may find this post months or years from now if it relates to an issue they are having).

Hope that helps, and that you find the information you seek.


In reply to Re: Any way to make it quicker? by atcroft
in thread Any way to make it quicker? by zendran

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.