I think you want to take a good look at IPC::Open2 and IPC::Open3, both standard modules (they come with perl). The difference between the two is is that the latter allows you to capture STDERR, too.
Comment on Re: Executing command from perl script with input/output