使用草莓(便携)Perl(适用于Windows 7)安装Mechanize时出现问题

使用草莓(便携)Perl(适用于Windows 7)安装Mechanize时出现问题,windows,perl,mechanize,portability,Windows,Perl,Mechanize,Portability,我在其他地方看到过关于堆栈溢出的帖子,其中指出我在安装Mechanize以用于草莓Perl时遇到的那种问题是由于公司防火墙引起的,但我不是在公司防火墙后面。我确实使用ISP调制解调器,我的桌面上安装了防病毒软件。如何配置cpan以避免此问题 ---------------------------------------------- Welcome to Strawberry Perl Portable Edition! * URL - http://www.strawberryperl.c

我在其他地方看到过关于堆栈溢出的帖子,其中指出我在安装Mechanize以用于草莓Perl时遇到的那种问题是由于公司防火墙引起的,但我不是在公司防火墙后面。我确实使用ISP调制解调器,我的桌面上安装了防病毒软件。如何配置cpan以避免此问题

----------------------------------------------
 Welcome to Strawberry Perl Portable Edition!
 * URL - http://www.strawberryperl.com/
 * see README.TXT for more info
----------------------------------------------
Perl executable: C:\portableperl\perl\bin\perl.exe
Perl version   : 5.18.2 / MSWin32-x64-multi-thread


C:\portableperl>cpan WWW:Mechanize
CPAN: CPAN::SQLite loaded ok (v0.203)
CPAN: LWP::UserAgent loaded ok (v6.05)
CPAN: Time::HiRes loaded ok (v1.9726)
Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to cpan.strawberryperl.com:80 (B
ad hostname)]
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t
xt.gz.tmp2828'. Giving up on it.
Fetching with LWP:
http://www.cpan.org/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (Bad hostname
)]
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t
xt.gz.tmp2828'. Giving up on it.
Fetching with LWP:
http://www.cpan.org/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (Bad hostname
)]
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t
xt.gz.tmp2828'. Giving up on it.
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t
xt.gz.tmp2828'. Giving up on it.
No external ftp command available

Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to cpan.strawberryperl.com:80 (B
ad hostname)]
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t
xt.gz.tmp2828'. Giving up on it.
Fetching with LWP:
http://www.cpan.org/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (Bad hostname
)]
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t
xt.gz.tmp2828'. Giving up on it.
Fetching with LWP:
http://www.cpan.org/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (Bad hostname
)]
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t
xt.gz.tmp2828'. Giving up on it.
Warning: no success downloading 'C:\portableperl\cpan\sources\authors\01mailrc.t
xt.gz.tmp2828'. Giving up on it.
No external ftp command available

CPAN: YAML::XS loaded ok (v0.41)
Please check, if the URLs I found in your configuration file
(http://cpan.strawberryperl.com/, http://www.cpan.org/,
http://www.cpan.org/) are valid. The urllist can be edited. E.g. with 'o
conf urllist push ftp://myurl/'

Could not fetch authors/01mailrc.txt.gz


C:\portableperl>

给定错误消息列表:

LWP failed with code[500] message[Can't connect to cpan.strawberryperl.com:80 (Bad hostname)]
LWP failed with code[500] message[Can't connect to www.cpan.org:80 (Bad hostname)]
我建议您的internet连接、防火墙或您授予cpan的权限有问题

我怀疑您可能可以通过web浏览器访问上述两个URL中的任何一个


尝试以管理员身份运行cmd提示符,然后重试。

问题已解决。这是我机器上运行的该死的杀毒软件

是的,我可以在浏览器中访问这两个网站(尽管第一个网站会重定向)。我以管理员的身份运行时会得到相同的结果,但在使用管理员权限启动cmd shell后,我启动了草莓.bat文件,可能它不会继承这些权限。我对cmd执行上下文一无所知。请在命令窗口C:\Users\JGS>ping cpan.strawberryperl.com中尝试
ping cpan.strawberryperl.com
ping www.cpan.org
有32字节的数据:从69.163.179.35回复:字节=32时间=64ms TTL=56从69.163.179.35回复:字节=32时间=64ms TTL=56从69.163.179.35回复:字节=32时间=64ms TTL=56从69.163.179.35回复:字节=32时间=62ms TTL=56 Ping 69.163.179.35统计:数据包:发送=4,接收=4,丢失=0(0%丢失),以毫秒为单位的近似往返时间:最小=62ms,最大=64ms,平均=63msC:\Users\JGS>ping www.cpan.org Pinging cpan-global.l.developer.org[207.171.7.91]有32字节的数据:从207.171.7.91回复:字节=32时间=64ms TTL=55从207.171.7.91回复:字节=32时间=63ms TTL=55从207.171.7.91回复:字节=32时间=62ms TTL=55从207.171.7.91回复:字节=32时间=62ms TTL=55 Ping 207.171.7.91统计:数据包:发送=4,接收=4,丢失=0(0%丢失),以毫秒为单位的近似往返时间:最小值=62ms,最大值=64ms,平均值=62ms C:\Users\JGS>