my $cmd = ...; my $pid; my $fh; my @out; eval { local $SIG{ALRM} = sub { die "Timeout\n" }; alarm 5; $pid = open($fh, '-|', $cmd) or die; @out = <$fh>; undef $fh; alarm 0; }; kill TERM => $pid if defined($fh);
In reply to Re: eval leaving processess behind
by ikegami
in thread eval leaving processess behind
by leonidlm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |