Uh... "premature end error"? As in HTTP server error response? If this is indeed the case, try running the thing from the command line, or at least printing a text/plain header somewhere ahead of the block above.
Maybe on that iteration that didn't puke, the application being run via IPC::Run didn't output anything?
Thanks for the reply. Its the "process ended prematurely" error. Sorry I didn't take the time to look up the error rather than go from poor memory.
Perhaps I am misunderstanding how this works but there indeed may not be any output on the first call to 'pump'. However, there is definitely input. I then try to drain any output in the 'pumpable' loop before going on to the next input string.
Therefore the way I think it works this condition should never happen unless there is a bug in the 'pumpable' function. If I am misunderstanding, please correct me as that would be the solution to my problem.