Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: IPC::Open3 woes

by rjray (Chaplain)
on Mar 10, 2002 at 22:36 UTC ( [id://150776]=note: print w/replies, xml ) Need Help??


in reply to IPC::Open3 woes

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://150776]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-19 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found