in reply to collect output of system()
Update: Here is a code fragment to do this:
use IPC::Open2; use File::Temp; my ($fh, $path) = tempfile(); unlink($path); # automatically releases storage on exit my $pid = open2($fh, \*STDIN, ’some', 'cmd', 'and', 'args'); waitpid $pid, 0; # wait for child to exit # now you can read the child's output from $fh
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: collect output of system()
by vic (Initiate) on Feb 27, 2008 at 17:04 UTC |