The IPC::Open2 module (part of the standard perl distribution) is an
easy-to-use approach that internally uses pipe(),fork(), and exec() to do the job. Make sure you
read the deadlock warnings in its documentation, though (see Open2).