免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1939 | 回复: 1

如何指定所调用模块的路径? [复制链接]

论坛徽章:
1
丑牛
日期:2014-02-14 17:07:04
发表于 2012-02-24 17:18 |显示全部楼层
本帖最后由 ace_fei 于 2012-02-24 21:12 编辑

我今天将服务器上的perl升级到5.14.2,但是我发现打印$ua里面还使用/usr/lib/perl5/site_perl/5.8.8/LWP/下面的包,怎么能换成5.14的?


$ find `perl -e 'print join "\n",@INC'` -name "*UserAgent*"
/usr/lib/perl5/5.14.2/CPAN/LWP/UserAgent.pm
/usr/lib/perl5/site_perl/5.8.8/LWP/UserAgent.pm
  1. #!/usr/bin/perl
  2. BEGIN{
  3.     use lib '/usr/lib/perl5/5.14.2';
  4. }
  5. use 5.14.2;
  6. use LWP;
  7. use Data::Dumper;
  8. my $ua = LWP::UserAgent->new;
  9. print Dumper($ua);
复制代码
$VAR1 = bless( {
                 'max_redirect' => 7,
                 'ssl_opts' => {
                                 'verify_hostname' => 1
                               },
                 'protocols_forbidden' => undef,
                 'show_progress' => undef,
                 'handlers' => {
                                 'response_header' => bless( [
                                                               {
                                                                 'owner' => 'LWP::UserAgent::parse_head',
                                                                 'callback' => sub { "DUMMY" },
                                                                 'm_media_type' => 'html',
                                                                 'line' => '/usr/lib/perl5/site_perl/5.8.8/LWP/UserAgent.pm:683'
                                                               }
                                                             ], 'HTTP::Config' )
                               },
                 'no_proxy' => [],
                 'protocols_allowed' => undef,
                 'local_address' => undef,
                 'use_eval' => 1,
                 'requests_redirectable' => [
                                              'GET',
                                              'HEAD'
                                            ],
                 'timeout' => 180,
                 'def_headers' => bless( {
                                           'user-agent' => 'libwww-perl/6.04'
                                         }, 'HTTP::Headers' ),
                 'proxy' => {},
                 'max_size' => undef
               }, 'LWP::UserAgent' );

论坛徽章:
78
双子座
日期:2013-10-15 08:50:09天秤座
日期:2013-10-16 18:02:08白羊座
日期:2013-10-18 13:35:33天蝎座
日期:2013-10-18 13:37:06狮子座
日期:2013-10-18 13:40:31双子座
日期:2013-10-22 13:58:42戌狗
日期:2013-10-22 18:50:04CU十二周年纪念徽章
日期:2013-10-24 15:41:34巨蟹座
日期:2013-10-24 17:14:56处女座
日期:2013-10-24 17:15:30双子座
日期:2013-10-25 13:49:39午马
日期:2013-10-28 15:02:15
发表于 2012-02-24 17:38 |显示全部楼层
LWP的版本没变化就行了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP