Pretty much and much more succinct, except by 'already using threads' i meant that the solution seems to be using threads (as per your demonstration). Originally I was just going to run each executable one at a time and I'm pretty sure I could do that in the way you've explained, but I think it would be possible to speed up the process with threads. 20 was just a guesstimate, and really what I need is 'run the number of simultaneous threads that won't make my little laptop choke and die'

I have anywhere from 1000 to 5000 (ballpark) commands to run. Each is the same command just with a different workstation name passed as a command line option each time. The application itself doesn't provide any sort of facility that i know of for passing multiple hostnames at once and the timeout option it provides doesn't actually work.

The executable is marimba's runchannel.exe and the result is one of: 1) timeout (check with Net::Ping prior to trying and I'm assured ICMP doesn't bounce anywhere) 2) Success 3) Successful Connection, Operation Unnecessary 4) Unable to connect 5) Completely hang and never respond. I need to be able to report the first 4 results along with the workstation name, and the small number that fall into #5 I can safely ignore for the time being, but those are the ones that are causing me difficulties to script because they never return (and I've run this from commandline manually and using another tool and the same thing happens). I was able to run this once using Win32::Process->Wait() but all of the output went to stdout and I couldn't find a way to log it with the workstation name (i.e. if i change the process to cmd /c foo.exe all it outputs to file is a list without the workstation names)


In reply to Re^6: Win32::Process output by Anonymous Monk
in thread Win32::Process output by tawnos

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.