in reply to Re^2: IPC::Open3 not connecting network socket handle
in thread IPC::Open3 not connecting network socket handle

well, mostly, I agree with what you say, but...

This bug in IPC::Open3 that was only solved during the 5.8.x series has beating me a couple of times. If you want your script to work with older perls you have to put in place a workaround that will remove the shorten code advantage.

IPC::Open3 inners are very complex. If something goes wrong there, debugging it could be a nightmare.

Finally, I don't like this reminiscent 2-args-open syntax "<&FOO" that doesn't play well with lexical file handles. Using "<&".fileno($new_sock) is, well, ugly at least.

So, considering all of this, I don't see IPC::Open3 as a clear winner when compared with the code in my previous post.

Replies are listed 'Best First'.
Re^4: IPC::Open3 not connecting network socket handle
by ikegami (Patriarch) on Jul 24, 2009 at 16:33 UTC

    IPC::Open3 inners are very complex. If something goes wrong there, debugging it could be a nightmare.

    It's actually very straightforward if you enough to roll out your own solution. You can't have it both ways. It's either too complex to roll out your own solution, or it's easy to debug.

    Using "<&".fileno($new_sock) is, well, ugly at least.

    Yeah, and he was fortunate he didn't need to use gensym in this case.