Tengo los siguientes scripts:
test.pl:
#use LWP::UserAgent;
use Parallel::ForkManager;
my $forker = Parallel::ForkManager->new(5);
foreach my $child ( 1 .. 5 ) {
$forker->start and next;
for (my $i = 0; $i < 1; $i++) {
`perl down.pl`;
#print "child numero ",$child," con respuesta ",$response->code," ", $response->message,"\n";
}
$forker->finish;
}
$forker->wait_all_children;
down.pl:
use LWP::UserAgent;
my $ua = new LWP::UserAgent(agent => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5');
my $response = $ua->get("http://pagina.com"); ...