in reply to Re^2: Non Blocking input on Win32 platforms
in thread Non Blocking input on Win32 platforms

If you need to hook STDIN & STDOUT for an external process, and that external process cooperates, then Win32::SocketPair is a neat solution...which is why I suggested it to you.

But spawning an entire process just to get command line input from the user is complicated overkill. A single thread and queue work very nicely for that.


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."
  • Comment on Re^3: Non Blocking input on Win32 platforms

Replies are listed 'Best First'.
Re^4: Non Blocking input on Win32 platforms
by TGI (Parson) on Nov 01, 2008 at 17:35 UTC

    It appears that my reading comprehension was poor yesterday. I've been fighting my own issues with stdio on windows (actually it seems to be related to issues of console inheritance and wperl), and it seems to have distorted my perception of the OP's problem.

    You are correct, it makes no sense to spawn a second process just to create a selectable IO source. But, I wasn't advocating that approach. Despite the fact that I communicated so poorly as to make it sound like I was.

    I recall our earlier exchange perfectly well.

    My comments on Win32::Socketpair (note the 'p') stem from the fact that you referenced a thread where it was discussed as a possible solution. In this context, I felt that sharing the shortcomings of Win32::Socketpair that I had recently discovered may be helpful.


    TGI says moo