in reply to Executing a program with in a perl script, and capturing the data in two ways

I'd suggest using open. Breifly, it would work something like this:
#!/usr/bin/perl -w use strict; my($program) = 'cat'; my(@ary); open(CAT,"$program ~/foo.txt |") || die "Unable to run $program: $!\n" +; foreach (<CAT>) { push @ary, $_; print "$_"; } close(CAT);
Of course, TIMTOWTDI, with backticks, for example. However, this method has worked well for me in the past.

Note: Taint checking is left as an exercise for the reader.

Hope that helps,
Shendal