Re: fork, read from child process and timeout

2010-05-13 Thread C.DeRykus
On May 11, 9:29 pm, dery...@gmail.com ("C.DeRykus") wrote: > On May 11, 12:56 am, weizhong@gmail.com (Weizhong Dai) wrote: > >> ... > > $pid = open(my $readme, "program arguments |") >                   or die "Couldn't fork: $!\n"; > my $timeout = 5; > eval { >     local $SIG{ALRM} = sub { die

Re: fork, read from child process and timeout

2010-05-12 Thread C.DeRykus
On May 11, 12:56 am, weizhong@gmail.com (Weizhong Dai) wrote: > Hi all, > > - > $pid = open(README, "program arguments |")  or die "Couldn't fork: $!\n"; > while () { >     # ...} > > close(README) > -- > > my problem is: I read fr

AW: fork, read from child process and timeout

2010-05-11 Thread Thomas Bätzler
Weizhong Dai asked: > - > $pid = open(README, "program arguments |") or die "Couldn't fork: > $!\n"; > while () { > # ... > } > close(README) > -- > > my problem is: I read from README, but if waiting for next input is > timeou

Re: fork, read from child process and timeout

2010-05-11 Thread Jeff Pang
2010/5/11 Weizhong Dai : > Hi all, > > - > $pid = open(README, "program arguments |")  or die "Couldn't fork: $!\n"; > while () { >    # ... > } > close(README) > -- > > my problem is: I read from README, but if  waiting for next input

fork, read from child process and timeout

2010-05-11 Thread Weizhong Dai
Hi all, - $pid = open(README, "program arguments |") or die "Couldn't fork: $!\n"; while () { # ... } close(README) -- my problem is: I read from README, but if waiting for next input is timeout, end reading. Is there any timer