#Copyright BEBELUSUL 2012 use Net::FTP; use Parallel::ForkManager; my $pm=new Parallel::ForkManager(300); open (HOSTS, 'rand'); while () { $pm->start and next; chomp; $host=$_; system ("./mail $host"); $pm->finish; } $pm->wait_all_children; close (HOSTS);