in reply to net::telnet problem

It's not clear what you're trying to do, and I'm wondering if your approach is more complicated than it needs to be. It sounds like: And then what? Does the third(?) program produce some output that you want to capture on the windows box?

If that's roughly what your trying to do, Net::Telnet supports some amount of "Expect"-like behavior, so maybe you could leave out the second perl script, and run the command line program directly from the windows process, without the middle-man perl script running on the linux box. (Having two "Expect"-like scripts chained together this way seems unnecessary, and prone to all sorts of problems with deadlock.)

If I guessed wrong about what you're doing, you need to give more detail.