http://www.perlmonks.org?node_id=786436


in reply to Capturing both STDERR and STDOUT without shell redirect

Check out IPC::Run3