use HTTP::Lite; use threads; my $a = 0; my $i = 0; sub request { print "trying to open up $address\n", scalar(localtime), "\n"; $http = new HTTP::Lite; $req = $http->request("$address") or die "Unable to get document: $!"; $i++; my $content = $http->body(); print " Done with request for $address\n"; my $search_variable = "test"; if ( $content =~ m/$search_variable/) { $a++ while ($content =~ m/$search_variable/g); } print " Finished searching $address for $search_variable", scalar(localtime), "\n"; } my @addresses = ( 'http://www.website1.com', 'http://www.website2.com', . . . 'http://www.website50.com' ); #my $URLResult = $Result->Url; my @threads; foreach $address(@addresses) { my $thread = threads->create(\&request); push(@threads, $thread); } } foreach (@threads) { $_->join(); }