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); }
In reply to code explanation by venky4289
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |