in reply to Perl Open2/3 and .exe

system or pause is clearing the input queue, so you're sending the newline too soon.

For testing, I put sleep(2) before the print WW "\n";, and it worked fine.

Finding when to send the newline accurately will be tricky given what I said in my earlier response.