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 timeout; };  

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 (README) {     # ...} close(README) -- my problem is: I read from

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 (README) { # ... } close(README) -- my problem is: I read from README, but if waiting for next input is timeout, end reading. Is there any

Re: fork, read from child process and timeout

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

AW: fork, read from child process and timeout

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