Please use die. Please, please, please. Even if it is not the problem this time, it is a really bad idea to leave production code sitting around without error checks left in. The majority of time and energy is spent on maintaining code, and error checks make a massive difference in either narrowing down what the problem is or what it isn't.

As for the second part...(reads)...oops. I was giving advice based on my experiences with IPC::Open3, apparently on a straight piped open Perl does wait for you. In case you need to know that, when a child process is created and tries to die, it cannot finish dying until it tells its parent what its return status is. A process can wait in this last stage of death forever, and a process in that state is called a zombie. So if you spawn lots of children, then you have to check for them from time to time to avoid zombies.

Still for your use, consider using `` to run the system commands and collect output. Less code, and the error checks are done for you.

That may fix the problem, but still glancing in perldiag I see that your warning is supposed to indicate either a bug at the C level (in Perl or in an XS module) or else memory corruption. If you have no C modules you are going to and can reproduce the problem on another box, it is a Perl bug and you should use the perlbug utility to report it. First try to whittle it down to the smallest loop that you can which produces the problem. Then report it.


In reply to Re (tilly) 3: Attempt to free unreferenced scalar... by tilly
in thread Attempt to free unreferenced scalar... by Daniellek

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.