in reply to Re^3: Capture STDOUT and send to screen with open3 (updated)
in thread Capture STDOUT and send to screen with open3
I am sorry, I am trying it and it hangs. Here is what I am executing: What am I doing wrong? Also, will this print a line real time from cat as if output were not being captured?
my @cat = qw( cat ); run \@cat, '<pipe', \*PIPE, '>', new_chunker("\n"), sub { my $line = shift; print $line; push @out, $line; }, '2>', new_chunker("\n"), sub { my $line = shift; print STDERR $line; push @err, $line; } or die $?; print PIPE "some input\n"; close PIPE; print "out @out"; print "err @err";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Capture STDOUT and send to screen with open3
by haukex (Archbishop) on Mar 05, 2018 at 18:20 UTC |