cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
or do I have touse Proc::Queue size => 3; my $mech = WWW::Mechanize->new(timeout => 90); while (@urllist) { $pid = fork; if(defined ($pid) and $pid==0) { $mech->get($url); print "$mech->content()->as_HTML(); exit(0); } 1 while waitpid(-1, WNOHANG)>0; # reaps childs }
?use Proc::Queue size => 3; while (@urllist) { $pid = fork; if(defined ($pid) and $pid==0) { my $mech = WWW::Mechanize->new(timeout => 90); $mech->get($url); print "$mech->content()->as_HTML(); exit(0); } 1 while waitpid(-1, WNOHANG)>0; # reaps childs }
Many thanks...
Steve
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Fork and WWW::Mechanize: Can agent be shared?
by andyford (Curate) on Feb 18, 2007 at 17:16 UTC | |
Re: Fork and WWW::Mechanize: Can agent be shared?
by shmem (Chancellor) on Feb 18, 2007 at 21:06 UTC | |
Re: Fork and WWW::Mechanize: Can agent be shared?
by perrin (Chancellor) on Feb 18, 2007 at 17:17 UTC | |
Re: Fork and WWW::Mechanize: Can agent be shared?
by ikegami (Patriarch) on Feb 19, 2007 at 18:18 UTC | |
Re: Fork and WWW::Mechanize: Can agent be shared?
by TOD (Friar) on Feb 19, 2007 at 04:15 UTC | |
Re: Fork and WWW::Mechanize: Can agent be shared?
by jdrago_999 (Hermit) on Feb 19, 2007 at 18:22 UTC | |
Re: Fork and WWW::Mechanize: Can agent be shared?
by tphyahoo (Vicar) on Feb 20, 2007 at 13:20 UTC |