Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: IPC::Run - can i print the $out before the finish

by gabrielsousa (Sexton)
on Jan 25, 2017 at 22:08 UTC ( #1180343=note: print w/replies, xml ) Need Help??


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

manage to make it working. have a strange thing, the output is always of the first command :(
what i'm doing wrong
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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1180343]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2021-09-28 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?