[EMAIL PROTECTED] wrote:
> This doesn't work, because system forks itself:
>
> Parent
> `- child1 (opened by fork)
> `- child2 (opend by system of child1)
>
yes and sorry i misunderstood your question.
david
--
s,.*,<<,e,y,\n,,d,y,.s,10,,s
.ss.s.s...s.sss.s.ss
s.s.s...
On Mon, Dec 08, 2003 at 06:48:17PM -0800, david wrote:
> eval{
>
> local $SIG{ALRM} = sub { die 'alarm' };
>
> $child = fork;
>
> die 'fork' unless(defined $child);
>
> if($child){
> #--
> #-- give child 5 seconds to complete
>
On Dec 8, 2003, at 5:10 PM, [EMAIL PROTECTED] wrote:
On Tue, Dec 09, 2003 at 01:04:01AM +0100,
[EMAIL PROTECTED] wrote:
eval {
local $SIG{ALRM} = sub { die "alarm\n" };
alarm 10;
system($prog, @args);
alarm 0;
};
if($@ =~ /alarm/) {
# have to kill $prog;
# I tried with 'use POSIX qw
[EMAIL PROTECTED] wrote:
> On Tue, Dec 09, 2003 at 01:04:01AM +0100, [EMAIL PROTECTED]
> wrote:
>> eval {
>> local $SIG{ALRM} = sub { die "alarm\n" };
>> alarm 10;
>> system($prog, @args);
>> alarm 0;
>> };
>> if($@ =~ /alarm/) {
>> # have to kill $prog;
> # I tried with 'use POSIX q
On Tue, Dec 09, 2003 at 01:04:01AM +0100, [EMAIL PROTECTED] wrote:
> eval {
> local $SIG{ALRM} = sub { die "alarm\n" };
> alarm 10;
> system($prog, @args);
> alarm 0;
> };
> if($@ =~ /alarm/) {
> # have to kill $prog;
# I tried with 'use POSIX qw/sys_wait_h/;'
my $kid = waitpid -1
Hello,
I'm doing this:
eval {
local $SIG{ALRM} = sub { die "alarm\n" };
alarm 10;
system($prog, @args);
alarm 0;
}
if($@ =~ /alarm/) {
# have to kill $prog;
}
The problem is, that the process is still running after the perl
script has exited. And I have to kill it by hand. But I want p