in reply to Timing out backquoted executions
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";
|
|---|