Problems? Is your data what you think it is? | |
PerlMonks |
Alternative for Select for pipes in Windows?by matematiko (Novice) |
on Nov 05, 2010 at 17:24 UTC ( [id://869704]=perlquestion: print w/replies, xml ) | Need Help?? |
matematiko has asked for the wisdom of the Perl Monks concerning the following question: Dear monks; I am a winblowz user using ActiveState 5.10. I need to create a perl script (probablly convert it to exe later) that will be spawn by another c++ exe. Two anonymous unidirectional pipes will be created by the parent, one to be the child (my script) STDIN and the other one to be the child STDOUT. Additionally, my script will open a named pipe to communicate with another program already running but is not my child. Of course the script must enter an infinite loop, listen constantly for parent and the other program commands and produce a result accordingly. I have done this before when a script communicates to more than one socket using IO::Select. Example:
The problem I have is that after many attempts, my script did not work. Then yesterday I read somewhere that under windows, IO:Select works only with sockets not with pipes. Is there a known alternative for this scenario? I will really hate to have to learn another programming language. Resuming: -An existing program spawns my program and creates two anonumous pipes for STDIN and STDOUT -My program opens a named pipe with another already running program which is not my child. -My program should run in infinite loop, listen to both programs and "do something". A simple example will do the trick. Thanks a lot in advance. EDIT: Confirmed.... Win32::Socketpair fails to run in two different Windows distros (Strawberry 5.12 and ActivePerl 5.10) Since this suggestion is the more sound one I had found, I will continue to troubleshoot why Win32::Socketpair fails.... thanks for the help
Back to
Seekers of Perl Wisdom
|
|