Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
perl LWP html内容获取错误“;500罐';t连接到www.google.com:80(坏主机名';www.google.com';)”;_Perl_Perl Module - Fatal编程技术网

perl LWP html内容获取错误“;500罐';t连接到www.google.com:80(坏主机名';www.google.com';)”;

perl LWP html内容获取错误“;500罐';t连接到www.google.com:80(坏主机名';www.google.com';)”;,perl,perl-module,Perl,Perl Module,我无法使用LWP获取html的内容。 它在本地主机上工作,但linux服务器不工作,显示错误' #!/usr/bin/perl use strict; use warnings; use LWP; print "Content-type: text/html\n\n"; my $browser = LWP::UserAgent->new; my $url = "http://www.google.com"; my $respo

我无法使用LWP获取html的内容。 它在本地主机上工作,但linux服务器不工作,显示错误'

    #!/usr/bin/perl
    use strict;
    use warnings;
    use LWP;
    print "Content-type: text/html\n\n";
    my $browser = LWP::UserAgent->new;
    my $url = "http://www.google.com";
    my $response = $browser->get($url);
    my $html = $response->content;
    print $html;

请帮助修复错误?

在此处的工作方式与粘贴的完全相同。
主机www.ncbi.nlm.nih.gov是否从您的服务器解析?如何从我的服务器解析?本地主机正常工作,但redhat Linux服务器防火墙不工作,一些网站说代理问题是真的,如何修复代理?
    500 Can't connect to www.google.com:80 (Bad hostname 'www.google.com')