in reply to Re: IPC::Run - can i print the $out before the finish
in thread IPC::Run - can i print the $out before the finish
use IPC::Run qw( start pump finish timeout new_chunker); my @cmd=('lftp', '-u', "$user,$pass", '-e', "open", "$host"); #my $h = start \@cmd, \$in, \$out, \$err, timeout( 5 ); my $h = start \@cmd, \$in, '>' => new_chunker, sub { push @out, @_ }, + timeout( 5 ); $in = "cls -1\n"; pump $h until @out; print @out; $in = "ls\n"; pump $h until @out; print @out; print @out; finish $h;
|
|---|