in reply to Re^2: Timing out backquoted executions
in thread Timing out backquoted executions
Note; code is untested.# set up alarm... my $pid; $SIG{ALRM} = sub { kill $pid; die "Timed out" }; alarm(5); $pid = open PROG,"/some program|" or die "Can't fork: $!"; my $input = join('',<PROG>); alarm(0); close PROG;
update: added alarm() calls.
|
|---|