You can open the subprocess as a filehandle and then read from that filehandle. See open for the simplest case and IPC::Open2IPC::Run2 and IPC::Open3IPC::Run3 for the more complex cases.
my $cmd = '/engine/monitor'; my $pid = open my $fh, '-|', $cmd or die "Couldn't launch [$cmd]: $!/$?"; for( 1..10) { print scalar <$fh>; }; close $fh; # kills the child when it next tries to write kill $pid;
In reply to Re: Getting output from continuous program
by Corion
in thread Getting output from continuous program
by jake7176
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |