If IPC::Run does what you need, look at how it does that, and re-implement it (or just plain copy & paste, as AnonMonk suggested; but make sure to check its license first).
Reimplementing the wheel is bad enough, no need to redesign it as well.
Comment on Re: capture child process STDOUT/STDERR on Win32