in reply to
get stdout stderr
I don't know if this is directly related to your issue and I've never worked with IO::CaptureOutput, but I've had difficulty shelling out in the past while capturing output to scalars. Detailed in STDOUT redirects and IPC::Open3, essentially the fileno of my output handles no longer corresponded to 0,1 and 2, and so the linking was lost on system call. The only solution I've found, assuming this is your issue, is rolling my own system call wrapper with pipe and fork, like in Re: How to capture child process output and divert to log4perl. In some cases, depending on some particulars, I've had to explicitly open unused filehandles to hold onto the right filenos until I needed them -- the system doles out filenos by the lowest one available.
Or all this could be off base for your case.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.