in reply to Executing a program with in a perl script, and capturing the data in two ways
Of course, TIMTOWTDI, with backticks, for example. However, this method has worked well for me in the past.#!/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);
|
|---|