in reply to Re^2: Win32: Redirect STDOUT to socket
in thread Win32: Redirect STDOUT to socket

how does Perl do qx() in Win32?

There is a parameter bInheritHandles on CreateProcess() that needs to be set for spawned processes to inherit their parents open handles. That is a part of what qx// does.

You can access it using Win32::CreateProcess().


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^4: Win32: Redirect STDOUT to socket
by repellent (Priest) on Feb 10, 2009 at 07:34 UTC
    Thanks so much for the links! I tried to have the newly created process inherit filehandles from the calling process with no luck. Perhaps I'm missing something? See UPDATE #2.

      Sorry, but posting updates to the root node, and then new nodes saying you've done so just makes life harder for everyone. Why not just post the update in the new node?

      You are still using fork which gives you a thread not a process on win32. And you are still trying to use AF_UNIX, SOCK_STREAM, on win32 which doesn't make any sense as Win32 doesn't know about unix sockets.

        Will do. I was just trying to keep the root node up-to-date with where I'm at so far. In other SoPW posts, I personally felt it was difficult to track sequence when Notes branched out too much, often wishing that the OP would indicate which solution worked best with an update. YMMV.

        I have been playing around a lot with Win32::Process and this will require more meditation on my part. After much experimentation, I got a feel of the internals and now realize how the threaded fork gets in the way of the expectations of the OP.

        Thanks again, you've been a big help :)