一段代码?perl语言,请熟悉perl的朋友帮忙!

一段代码?perl语言,请熟悉perl的朋友帮忙!
这段代码是用于自动投票系统的,动态修改ip,请熟悉的朋友帮忙解释一下,如果愿意的话,可以帮忙修改一下,实现增加点击。

#!/usr/bin/perl

use strict;
use warnings;
use threads;
require HTTP::Request;
require HTTP::Cookies;
require LWP::UserAgent;

# 全局变量
my @thr;
my $thread_id=0; #线程ID号
my $i = 0;

#子连接线程
sub connect {
my $proxy_ip=shift;
my $proxy_id=shift;
my $success = "总票数";
my $query_string = 'TC000626%5B%5D10=14&problemid1=TC000626&problem1=%CA%D7%BD%EC%A1%B0%D6%D0%B9%FA%CA%AE%B4%F3%B5%B1%B4%FA%D0%EC%CF%BC%BF%CD%A1%B1%D7%DC%BE%F6%D1%A1&text01=hemon&text02=&text03=07917747447&classid=20060425TC01&receipt=1&image=red.gif&count=1&view=0&poll=%CD%B6%C6%B1';

my $request=HTTP::Request->new(POST=>'http://survey.it.sohu.com/manage/poll/poll.php');
$request->content($query_string);
$request->referer('http://travel.sohu.com/s2006/xxkpx/');
$request->header( 'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, */*',
'Host' => 'survey.it.sohu.com',
'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Content-Type' => 'application/x-www-form-urlencoded'
);

my $ua= LWP::UserAgent->new;
$ua->cookie_jar(HTTP::Cookies->new(file => "cookies.txt"));
$ua->proxy(['http'],"http://".$proxy_ip."/");
$ua->timeout(10);
my $response = $ua->request($request);
#print "============================================\n";
#print $response->content;
#print "============================================\n";
if ($response->is_success) {

#print "============================================\n";
if($response->content =~/$success/g) {
#print "============================================\n";
print "\t$proxy_id票成功!\n";
$i++;
}else{
#print "============================================\n";
print "\t$proxy_id票失败!\n";
}
#print proxyFile "$proxy_ip\n";
}else{
#print "Bad connetction proxy of $proxy_id== $proxy_ip\n";
return -1;
}
}

#Read file
sub getIpArray{
my @iparray;
open (proxyFile,"proxy.txt") or die "can't open proxy.txt!\n";
while (chomp(my $ip=<proxyFile>))
{
push (@iparray, $ip);
}
close(proxyFile);
return(@iparray);
}

#模拟出一个已经自动取回的代理列表
my @iparray = &getIpArray;

#open (proxyFile,">>proxy_.txt") or die "can't open proxy_.txt!\n";

#建立线程队列
#while(1){
#($sec1,$min1,$hour1)=localtime(time);

foreach my $ips (@iparray) {
$ips =~s/\@HTTP//;
print "$thread_id======>".$ips."\n";
$thr[$thread_id]= threads->create(\&connect,$ips,$thread_id);
$thread_id=$thread_id+1;
sleep 1;
}
$thread_id--;

#结束线程队列
for(0..$thread_id){
print "Joined $_\n";
$thr[$_]->join();
}

#($sec2,$min2,$hour2)=localtime(time);
#sleep (1000);
#die;
#}
#close(proxyFile);

#system('pause');