Hi,

My program looks like this:

my $pid = fork ();
if ($pid == 0){
  exec ("top");
}else{
   my $time = 0
   while (<1>){
     sleep 1;
     $time++;
     if ($time == 10){
         kill 9, $pid;
     }
   }
}


That is, after running the forked "top" process for 10 seconds, the main 
program will end it.

Any idea why it's not working for me?

Thanks




      

-- 
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