use strict; use warnings; my $timeout = 3; eval { local $SIG{ALRM} = sub { die "alarm\n" }; alarm $timeout; `perl -e "while(1) { }"`; alarm 0; }; if ($@) { die "DID timeout after $timeout second(s)\n"; } print "never see this text\n";
In reply to Re: Timing out backquoted executions
by liverpole
in thread Timing out backquoted executions
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |