adismaug has asked for the wisdom of the Perl Monks concerning the following question:
Regards,#!/usr/bin/perl use LWP::Simple; use Time::HiRes qw(time); use Parallel::ForkManager; my $filename = "/tmp/result.log"; while ($z <=200) { $z++; my $i = 1; my $pm = new Parallel::ForkManager(20); my $t0 = time; my $num = 10; unlink("$filename"); open FH, ">:utf8", $filename; while ($i < $num) { $i++; $pm->start and next; $contents = get("http://test.com/b.php?page=$i"); print FH "$contents\?"; $pm->finish; } $pm->wait_all_children; $elapsed = time - $t0; print "$elapsed elapsed\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: TCP socket and fork
by afoken (Chancellor) on Jul 04, 2009 at 11:18 UTC | |
by adismaug (Acolyte) on Jul 04, 2009 at 11:29 UTC | |
by afoken (Chancellor) on Jul 04, 2009 at 12:04 UTC | |
by adismaug (Acolyte) on Jul 04, 2009 at 12:26 UTC | |
by afoken (Chancellor) on Jul 04, 2009 at 16:58 UTC |