To my knowledge, there is no relationship between Forks, and Thread or threads other than that Forks attempts to emulate the threads interface using fork'd processes instead of threads.

And going by your demonstration of the failure, the problem appears to clearly lie entirely within, or as a side effect of using the Forks module, and I see no way that re-building perl would have any effect whatsoever.

Out of curiosity I went to cpan to look up the current maintenance status of the module and whilst browsing around, discovered this snippet in the POD:

Modules that modify $SIG{CHLD}

In order to be compatible with perl's core system() function on all platforms, extra care has gone into implementing a smarter $SIG{CHLD} in forks.pm. If any modules you use modify $SIG{CHLD} (or if you attempt to modify it yourself), you may end up with undesired issues such as unreaped processes or a system() function that returns -1 instead of the correct exit value. See perlipc for more information regarding common issues with modifying $SIG{CHLD}.

Which sounds an aweful lot like the problem you are experiencing, albeit that you are not modifying %SIG. If you are set on continuing to use Forks, then it might be as well to contact the new maintainer.

Alternatively, if you just need to run a ping asynchrounously, using threads:

use threads; use threads::shared; my $pingStatus : shared = undef; async{ $pingStatus = system 'ping', ...; }; .... do other stuff if( $pingStatus == ? ) { ## .... }

Or, even simpler, especially if you need to ping multiple targets concurrently, use Net::Ping in 'syn' mode, which is far more efficient than any other method.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^5: bad ping status with the forks module by BrowserUk
in thread bad ping status with the forks module by Anonymous Monk

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.