in reply to Passing ouput between program

One way is to use open with a pipe.

open(TWO, "| /your/second/program") or die "Dead $1\n";

Now instead of printing to STDOUT, print to the filehandle you just made:

print TWO "data data data\n";

In your second program that data is read in as STDIN:

print while(<>);
will print out "data data data".