加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Perl LWP 模块安装及遇到的问题

发布时间:2020-12-16 00:17:54 所属栏目:大数据 来源:网络整理
导读:1、首先打开http://search.cpan.org ?? 下载 libwww-perl-6.04.tar.gz 2、以为lwp依赖的模块较多,还需要下载下列模块 ?? HTTP-Message-6.06.tar.gz ?? HTTP-Date-6.02.tar.gz??? 3、遇到的一些问题 ? a、“ 501 Protocol scheme 'http' is not supported”

1、首先打开http://search.cpan.org

?? 下载 libwww-perl-6.04.tar.gz

2、以为lwp依赖的模块较多,还需要下载下列模块

?? HTTP-Message-6.06.tar.gz

?? HTTP-Date-6.02.tar.gz???

3、遇到的一些问题

? a、“ 501 Protocol scheme 'http' is not supported”

???????? 发生这个错误的原因:安装Net::HTTP?module.故无法识别这个协议

? b、“Can't locate Encode/Locale.pm”

??????? 安装下面的模块 Encode-Locale-1.03.tar.gz


4、HTTP::Response object 有以下一些有价值的属性:

  • 一个 status code(状态代码值),表示成功或失败。你可以使用 $response->is_success 来检测它。
  • http status line(http 状态描述),观察 $response->status_line 的结果 ( 比如 "404 Not Found" ) 会帮助你理解这个词的意思。
  • MIME content-type(文件类型)通过 $response->content_type 来获得。例如 "text/html","image/gif","application/xml" 等等。
  • content of the response(响应返回的内容)储存在 $response->content。内容可能是 html 格式。如果是 GIF 格式,$response->content 里是二进制的 GIF 数据。
  • 许多其他 methods 都可以在 HTTP::Response 和它的 superclasses (父 class) HTTP::Message 和 HTTP::Headers 里找到。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读