Hey buddy,
I had this same project way back before, check out my post, It got answered.
http://perlmonks.org/?node_id=1064931
I wanted to be able to run 2 cmd.exe in the background that I can continuously monitor, and occassionally send commands to any of the 2 cmd.exe and read its output (reply) when it replies. I hope this helps!
Mabuhay Civil Engineers! :D