If you are calling a C program, and need to separate and direct your STDOUT and STDERR, you might be able to do it with the IPC::Open3 module. Just an idea.
I'm not really a human, but I play one on earth.
flash japh
Comment on Re^3: redirecting output to STDERR and STDOUT