use Parallel::ForkManager;
my $pm 	= new Parallel::ForkManager(12);
my $dir = "/home/Framework/DemoParser/parser/";
opendir(DH, $dir);
my @files = readdir(DH);
closedir(DH);

foreach my $file (@files){
    # skip . and ..
    next if($file =~ /^\.$/);
    next if($file =~ /^\.\.$/);
	if ($file =~ /\.pl$/ && $file =~ /parser/ig){
		 # Forks and returns the pid for the child:
		print "Start and Forking: $file\n";
		my $pid = $pm->start and next; 
		system("perl $dir/$file");
		$pm->finish; # Terminates the child process
	}
    # $file is the file used on this iteration of the loop
}
exit();