Thanks for your thoughts!

I have been checking the full value returned from system as well - I should have mentioned that.

This is a new one on me - I've not seen it in 20 something years of working with perl. I agree that there's something happening in the child process (ie I'm quite sure the return value of system is correct), however the very last thing to happen in these failing processes is basically:

logprint("Process completed successfully"); exit(0); # As part of testing we've even added exit with an explicit 0 + as here

And yet the calling processing detects a non-zero return code - and (having been logging this return code in detail) it is always a return code of 1 (after >>8) or to quote some debugging output we've added:

DEBUG TEST 1 uses the if/then/else described in perldoc -f system: DEBUG TEST 1 CASE(else): child exited with value 1 DEBUG TEST 2 uses the POSIX::W* checks of perlvar ${^CHILD_ERROR_NATIV +E} which is: 256 (binary: 0000000100000000) DEBUG TEST 2: POSIX::WIFEXITED returned true (child exited normally) DEBUG TEST 2: POSIX::WEXITSTATUS returned: 1 (binary: 0000000000000001 +)

In reply to Re^2: system >> 8 is non-zero when child exits with exit(0) by bjdean
in thread system >> 8 is non-zero when child exits with exit(0) by bjdean

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.