my @dirs = ( "/path1", "/path2",... ); foreach my $dir (@dirs) { next unless -d $dir; my $kidpid = fork(); if($kidpid == 0){ # Child here my @makelists = `find $dir -name .makelist`; foreach my $file (@makelists) { if (-e "$dir/$file") { ProcessMakeList($file); } else { print "bad $file\n"; } } exit 0; } }