2012-01-29 165 views
1

我正在使用LWP :: UserAgent执行一个简单的HTTP Post并获取下面的错误。在网上进行了大量搜索之后,似乎有一段时间后出现了一个问题,这个问题已经解决。我的版本6.03应该被修复。任何想法为什么发生这种情况?LWP读取失败错误

'_content' => 'read failed: at /usr/local/share/perl/5.10.1/Net/HTTP/Methods.pm line 256 
at /usr/local/lib/perl/5.10.1/Net/SSL.pm line 211 
     Net::SSL::die_with_error(\'LWP::Protocol::https::Socket=GLOB(0x8d9aa38)\', \'read failed\') called at /usr/local/lib/perl/5.10.1/Net/SSL.pm line 224 
     Net::SSL::read(\'LWP::Protocol::https::Socket=GLOB(0x8d9aa38)\', \'\', 1024, 0) called at /usr/local/share/perl/5.10.1/Net/HTTP/Methods.pm line 256 
     Net::HTTP::Methods::my_readline(\'LWP::Protocol::https::Socket=GLOB(0x8d9aa38)\', \'Status\') called at /usr/local/share/perl/5.10.1/Net/HTTP/Methods.pm line 343 
     Net::HTTP::Methods::read_response_headers(\'LWP::Protocol::https::Socket=GLOB(0x8d9aa38)\', \'laxed\', 1, \'junk_out\', \'ARRAY(0x8cd3d98)\') called at /usr/local/share/perl/5.10.1/LWP/Protocol/http.pm line 378 

下面是代码示例:

use LWP::UserAgent; 
use Data::Dumper; 

my $ua = LWP::UserAgent->new; 
$ua->timeout(10); 
$ua->env_proxy; 

my $response = $ua->get('https://metacpan.org/module/LWP::UserAgent'); 
print Dumper($response); 
+0

您能否提供一个小代码示例来演示如何引发错误。 – dgw 2012-01-29 17:35:58

+0

当我运行这个代码(LWP :: UserAgent :: VERSION 6.03)时,一切正常。 – dgw 2012-01-29 19:28:10

+0

嗯,我检查了所有相关软件包是最新的。可能是盒子有问题? – MadHacker 2012-01-29 20:23:07

回答

相关问题