http://www.perlmonks.org?node_id=968874

saurya1979 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have a scenario where in there are 10 destinations to rsync. I want to run 5 processes at a time to perform rsync for 5 destinations(I can do it with fork) BUT I want to run the 6th process for 6th destination as soon as 1 of the 5 running processes is complete. I don't want to wait for all the 5 processes to complete and then start the next chunk. For every 1 process completes out of 5, another process should be fired. How can I achieve it using Perl? Thanks Saurya