#!/usr/bin/perl
use strict;
use warnings;

use WWW::Curl::Easy;
use WWW::Curl::Multi;

my $count = 5;
while ($count--) {
    if (my $pid = fork) {
	&doloop;
    }
    else {
	&doloop;
   }
}
exit;

INIT {
    my $curlm = new WWW::Curl::Multi;


    sub doloop
      {
    my $curl;

	  unless ($curl) {
	      $curl = new WWW::Curl::Easy;
	      $curlm->add_handle($curl);

	      $curl->setopt(CURLOPT_VERBOSE, 1);
	      $curl->setopt(CURLOPT_DNS_CACHE_TIMEOUT, -1);
	      $curl->setopt(CURLOPT_CONNECT_ONLY, 1);
	      $curl->setopt(CURLOPT_FORBID_REUSE, 1);
	      $curl->setopt(CURLOPT_URL, 'http://ftp.us.debian.org');
	  }
	  $curl->perform;
      }
}


