It's been a while since I used IPC::Open3, though I have used it in the past. If I am remembering correctly (the manual page is a little spare, unfortunately), the filehandles you pass in are then created for you as dupes of the relevant file handles from the child process. What this means in the short form is this: opening the two ahead of time and passing them in did nothing, they were closed and re-opened using dup() on the STDERR and STDOUT of the child.

More specifically, the idea of open3() is to give you (your program) the ability to read off those two file descriptors locally. So, after a successful return from open3, you should have been able to read off of OUTPUT and ERRLOG as if you had opened them for reading. Because of potential blocking issues, you are encouraged to use select before trying to read off of either handle.

In your case, where you want the output to go to specific files, according to the manual page you should open those filehandles with ">&", not just ">" as you are doing in your code. Try changing those lines, and see if that helps. If not, you can try doing the reading yourself.

And don't feel too bad-- I find the manual page here to be pretty unclear, as well.

--rjray


In reply to Re: IPC::Open3 woes by rjray
in thread IPC::Open3 woes by BazB

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.