perl 多进程基础

example:
my $maxchild=10;
 for($i=0;$i<=$maxchild-1;$i++)
 {
   my $child=fork();
    if($child) {   # child >; 0, so we're the parent 
        warn "launching child $child\n";
    }else{
        do_child($i);         # child handles  
     exit 0;             # child is done 
    }
}
 exit;
 sub do_child
 {
     my $child_number=shift(@_);
    print("child ,$child_number \n");
 }

你可能感兴趣的:(perl,perl)