gpt4 book ai didi

perl - 如何安装模块?草莓 Perl 问题

转载 作者:行者123 更新时间:2023-12-01 23:11:08 30 4
gpt4 key购买 nike

我正在尝试在 Windows 7 上的 Strawberry Perl 中安装 Perl 模块。

我正在运行以下命令,但收到大量我不理解的消息。看起来我收到了 500 个错误,就好像该页面无法访问一样。然而,当我在浏览器中指向镜像时,访问 FTP 目录没有问题。我在 Linux 上几乎没有 Perl 经验,在 Windows 上也没有。我尝试手动将镜像添加到 urllist,但我认为这没有帮助。

C:\Program Files> cpan Win32::IE::Mechanize

CPAN: LWP::UserAgent loaded ok (v5.835)
CPAN: Time::HiRes loaded ok (v1.9721)
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 (Bad hostname 'cpan.strawberryperl.com')]
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.
Fetching with LWP:
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz
LWP failed with code[500] message[LWP::Protocol::MyFTP: Bad hostname 'mirror.teklinks.com']
Fetching with Net::FTP:
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz
Could not connect to host 'mirror.teklinks.com' with Net::FTP
Fetching with Net::FTP
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz.gz
Could not connect to host 'mirror.teklinks.com' with Net::FTP
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.

As a last resort we now switch to the external ftp command 'C:\WINDOWS\system32\ftp.EXE'
to get 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'.

Doing so often leads to problems that are hard to diagnose.

If you're the victim of such problems, please consider unsetting the
ftp config variable with

o conf ftp ""
o conf commit

Issuing "C:\WINDOWS\system32\ftp.EXE -n"

Trying with external ftp to get
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz
Going to send the dialog
open mirror.teklinks.com
user anonymous win32-vanilla@perl.org
lcd C:\strawberry\cpan\sources\authors
cd /
cd CPAN
cd authors
bin
passive
get 01mailrc.txt.gz 01mailrc.txt.gz.tmp5264
quit

Unknown host mirror.teklinks.com.
Not connected.
Local directory now C:\strawberry\cpan\sources\authors.
Not connected.
Not connected.
Not connected.
Not connected.
Invalid command.
Not connected.
Bad luck... Still failed!
Can't access URL ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz.

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 (Bad hostname 'cpan.strawberryperl.com')]
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.
Fetching with LWP:
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz
LWP failed with code[500] message[LWP::Protocol::MyFTP: Bad hostname 'mirror.teklinks.com']
Fetching with Net::FTP:
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz
Could not connect to host 'mirror.teklinks.com' with Net::FTP
Fetching with Net::FTP
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz.gz
Could not connect to host 'mirror.teklinks.com' with Net::FTP
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.
Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'. Giving up on it.

As a last resort we now switch to the external ftp command 'C:\WINDOWS\system32\ftp.EXE'
to get 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp5264'.

Doing so often leads to problems that are hard to diagnose.

If you're the victim of such problems, please consider unsetting the
ftp config variable with

o conf ftp ""
o conf commit

Issuing "C:\WINDOWS\system32\ftp.EXE -n"

Trying with external ftp to get
ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz
Going to send the dialog
open mirror.teklinks.com
user anonymous win32-vanilla@perl.org
lcd C:\strawberry\cpan\sources\authors
cd /
cd CPAN
cd authors
bin
passive
get 01mailrc.txt.gz 01mailrc.txt.gz.tmp5264
quit

Unknown host mirror.teklinks.com.
Not connected.
Local directory now C:\strawberry\cpan\sources\authors.
Not connected.
Not connected.
Not connected.
Not connected.
Invalid command.
Not connected.
Bad luck... Still failed!
Can't access URL ftp://mirror.teklinks.com/CPAN/authors/01mailrc.txt.gz.

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

Could not fetch authors/01mailrc.txt.gz

最佳答案

这很容易是防火墙/代理问题。您需要在cpan中设置http_proxy变量。

通过在 shell 命令提示符处键入 cpan 并按 Enter 进入 CPAN shell。进入 CPAN shell 后,输入以下内容:

o conf http_proxy http://proxy.mycorp.com:8080/
然后,

cpan 可能会要求您提供用户名和密码,以便您至少可以使用 HTTP 流量的代理。

您的 FTP 访问可能被防火墙阻止。 cpan 将解决这个问题。

  • 如果代理配置很简单,您可以查看浏览器。
  • 如果更复杂,你就必须
    • 将配置脚本的URL粘贴到浏览器地址中
    • 当浏览器提示时,使用编辑器打开该 URL(或使用采用 HTTP URL 的编辑器,例如 jEditNotepad++。)。

解析您的位置和 CPAN 的大小写后,您可以获取返回的服务器名称,添加端口(如果有),然后使用该值设置环境变量或 cpan 配置。

关于perl - 如何安装模块?草莓 Perl 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6611382/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com