Can some one help me on this. The routine below works, but kills only
the parent job.
I want all the jobs spaned by parent job $f to be killed.  How to do
that ?
Thanks in advance.

sub run_system_for_some_time {
    my $f = $_[0];  ## Job to run
    my $t = $_[1]; ## Max time job can run
eval {

   local %SIG;
   $SIG{ALRM}=
     sub{ die "timeout reached, after $t seconds!\n"; };
   alarm $t;

   my $xx = system("$f") ; ## This job will span other jobs
   print("xx = $xx\n") ;
   alarm 0;
};

alarm 0;

if($@) { print "Job aborted in run_system_for_some_time $@\n"; }
}


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to