Good day monks. I am trying to get the hang of using multiple processes with WWW::Mechanize. I think I've just about got it figured out except for one thing. Can different processes share the same mech object? In other words can I
use 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
}
or do I have to
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