I think what we might need to see is a bit more of the code that you are working with to really get an idea as to what you are trying to do. Offhand, you might take a look at calling the program with open() or open a filehandle for your output and do a select to try to wrtie data into that filehandle.
"Ex libris un peut de tout"