If what you need is to launch a program and write to its standard input while reading from its standard output, you can use
if you also need standard error. Be sure to set autoflush on the filehandle you are writing to, and be sure that the program you are calling also flushes its standard output. Otherwise you will get a deadlock.