We use the term pipe to mean connecting a data flow from one process to another.
Perhaps the simplest way of passing data between two programs is with the popen and pclose functions:
Captureing output from an external program:
Sending output to an external program: