crashmonk has asked for the wisdom of the Perl Monks concerning the following question:
use LWP::UserAgent; my $pid = fork(); for (1..3) { if ($pid = fork()) { next; } if (defined $pid) { GET(); exit; } else { die "Fork failed\n"; } } sub GET { my $ua = LWP::UserAgent->new; $ua->agent("Perl 5.6"); my $req = HTTP::Request->new("GET", "http://perl.com/"); my $res = $ua->request($req); if ($res->is_success) { print "OK\n"; return $res->content; } else { die "HTTP::Request error"; } }
Please help me resolve it.
ps:You can suggest to use ParallelUA, but it's not possible in my case.
Thanks.2001-03-28 Edit by Corion: Moved to Seekers Of Perl Wisdom
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fork + HTTP::Request=perl.exe crash
by Corion (Patriarch) on Mar 28, 2001 at 19:09 UTC | |
|
Re: fork + HTTP::Request=perl.exe crash
by $code or die (Deacon) on Mar 30, 2001 at 08:58 UTC |