in reply to Read and write files concurrently in Perl
Maybe I'm reading too much into your example text, but this kind of query("Hello, how are you?") / response("Fine. How about you?") system is better implemented with pipes or sockets