venky4289 has asked for the wisdom of the Perl Monks concerning the following question:
thanks in advance.my $pid = fork; if ($pid > 0){ eval{ local $SIG{ALRM} = sub {kill 9, -$PID; die "TIMEOUT!"}; alarm $num_secs_to_timeout; waitpid($pid, 0); alarm 0; }; } elsif ($pid == 0){ setpgrp(0,0); exec('echo blahblah | program_of_interest'); exit(0); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: code explanation
by tmharish (Friar) on Mar 06, 2013 at 14:46 UTC | |
|
Re: code explanation
by Anonymous Monk on Mar 06, 2013 at 10:47 UTC |