On Feb 18, 2005, at 2:10 PM, Steve Hay wrote:
Both Nicholas and I have now asked exactly what the problem with IPC::Open3 on Win32 is, but have not yet received an answer. Presumably nobody is quite sure what, if anything, the problem is, so I thought I'd try and find out.
Good initiative :)
The attached program contains what I believe is the relevant code, lifted from CPANPLUS::Tools::Cmd, to try open IPC::Open3 vs IPC::Run.Best to lift from IPC::Cmd, as that's the library we're actually using -- cpanplus::tools::cmd is rather obsolete (luckily the ipc::open3 implementation hasn't changed.. the ipc::run one has though)
Running "perl test.pl open" runs the same $cmd via IPC::Open3 but produces just this:
===== C:\Temp>perl test.pl open err=[0] buffer=[] buferr=[] bufout=[] =====
And that's a $cmd that doesn't even involve pipes.
Yup, that's pretty much our experience.
Changing the $cmd to qq[$^X -e "open FH, '>C:/Temp/testout'"] reveals that the $cmd definitely is being executed; we're just losing all its output.[...]
Presumably IO::Select->can_read() doesn't work on Win32 because it uses a 4-arg select(), which is only implemented for sockets on Win32. Is the above change safe, or did we need to call can_read() for some reason? Would the proposed "selectable pipes" change have any impact on this?I have no idea myself, i'm not much of an IPC guru, i just RTFM'd on this. But if others can assure me it's safe & portable, it's an easy patch to do.
What do I need to do to test out whether IPC::Open3 is working with pipes or not? (Open3.t doesn't seem to include any such tests.)
That might be a very useful addition to the open3.t tests...
Perhaps something like this would work as a test case:
"$^X -e'print 1' | $^X -e'print 1 + <>'"
--
Jos Boumans
"If superman is so smart, why does he wear underpants over his trousers?"
CPANPLUS http://cpanplus.sf.net
