in reply to IPC::open3 obfuscification

The likely problem is that you check HIS_ERR before anything is written there, then wait on output to HIS_OUT. Meanwhile he sends output to HIS_ERR and waits for input on HIS_IN. (It is theoretically possible that there are additional buffering problems.)

There are generally 3 ways to go. First you can look for a real API to use that will be more reliable. Secondly you can learn about select, sysread and syswrite. This will let you follow 2 handles at once, but you will need to handle stuff that Perl normally takes care of with buffering. The third is that you can use a module like Expect to abstract away some of those details.

I would first look for an API, then I'd look at Expect. I would not hand-roll a solution from unbuffered IO.