A sneaking feeling tells me that you will shortly be
Suffering
from Buffering. (There is a similar warning in
IPC::Open3.) Namely if there is, for instance, a long
error statement, you may be trying to read from its STDOUT
while it is waiting for you to check its STDERR. This
might take a while...
You are likely to need the select command or its OO
wrapper IO::Select to do this properly. (I think you
will find IO::Select easier to figure out.)