in reply to fileno unexpectly returns undef

To elaborate on what tye said:  due to the stringification problem, lexical file handles can't be used with the "<&" / ">&" feature.  Use "old-style" file handles instead:

socketpair(STDERRCHILDWRITER, STDERRCHILDREADER, AF_UNIX, SOCK_STREAM, PF_UNSPEC) || die "socketpair: $ +!";

and then specify them as ">&STDERRCHILDREADER", etc. to open3().

(Can't say, though, whether this will eventually help with your stated cross-platform goal — but it should at least get rid of the immediate problem...)

Replies are listed 'Best First'.
Re^2: fileno unexpectly returns undef
by kees (Initiate) on Feb 24, 2012 at 11:39 UTC
    Thanks all for your reply. The main reason that I liked to use sockets was the drop of performance on Windows when using open3 to schedule a lot of processes (whith each having a pipe reader thread on stdout and stderr). The scheduler seems to hang on either launching new processes, or on the threaded-pipe-reader.

    The advantage of using sockets is that I can use select (also on Windows. select on pipes is not possible, and I did not like to work with Win32 WaitForMultipleObjects). I'm about finished with a prototype (not using open3 anymore), which seems to look promising (actually, I was able to get about 100% load on my dual six-core HT system).