Thanks for the info.

The hang is caused by the reading of the collection
$val = Win32::OLE::Enum->All($col) or $ok = 0;

Here is where the script locks/hangs.

I have tried to eval and alarm. Nothing is breaking
out if the commands hangs.
eval { local $SIG{ALRM} = sub { warn "ALARM FOR GET EXEC QUERY: \"$quer +y\" L: \"" . __LINE__ . "\" F: \"" . __FILE__ . "\"\n" }; # NB: \n re +quired alarm 5; $val = Win32::OLE::Enum->All($col) or $ok = 0; alarm 0; }; if($@) { $ret = $@; print "ERR: \"$ret\"\n"; $err = 1; $ret = "timeout while QUERY: \"$query\" wmi on + machine $host"; return($err, $ret); }


any suggestions on howto eval/jail this line, then
breakout/throw error in case the time/condition is met?

Only certain machines are causing the hang/lock. Most
of the machines breeze past within 5 seconds.

So iterating 5000 plus machines then hanging on a random
is a PITA.

TIA, Joe

In reply to Re^2: Problem enumerating a foreach loop using Win32::OLE->GetObject by t_rex_joe
in thread Problem enumerating a foreach loop using Win32::OLE->GetObject by t_rex_joe

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.