in reply to pipes and return data

I have been doing 2-way communications myself for a project. You might want to look a bit at the discussion on the topic here:

Concurrent Processes
IO::Select - is it right for this?

Hope these can give you some ideas.