Hey guys,

     I maybe misunderstanding what a fork can do, so I thought I would
write in to verify.  Because it doesn't appear to be doing what I want
(think it should).

I have a script that tars (unix) directories.  I want the script to tar
directories [a-n] as it is tarrring up [a-n] I want it to tar [o-z].  At
the same time.  So that two tars would be running st the same time.

   what I did was

#!/usr/bin/perl
use strict;
use warnings;

$SIG{CHLD} = sub {wait ()}; #wait to avoid zombies

my $pid = fork ();
die "cannot fork: $!" unless defined($pid);
if  ($pid == 0) {
     #do some perl stuff
   }
   exit(0);
}
waitpid($pid,0);

#do some other perl stuff while above is running.


  I want the perl script to "multi task".  

Am I missing something??

thanks,
Chad



Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to