Just trying GET three http://perl.com/ at the same time.

The next simple code crashes Perl.exe
The instruction at "0x28073b9f" referenced memory at "0x03277b8c". The memory 
could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program


<code>
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"; }
}
</code>

Please help me resolve it.

ps:You can suggest to use ParallelUA, but it's not possible in my case.

Thanks.
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl

Reply via email to