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

perl – 如何在没有root访问权限的情况下在本地安装CPAN模块(Dyn

发布时间:2020-12-15 21:42:48 所属栏目:大数据 来源:网络整理
导读:不适用于其他模块,但举一个例子.我使用CPAN设置安装了Text :: CSV_XS: 'makepl_arg' = q[PREFIX=~/lib], 当我尝试运行test.pl脚本时: $perl test.pl #!/usr/bin/perluse lib "/homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi";u
不适用于其他模块,但举一个例子.我使用CPAN设置安装了Text :: CSV_XS:
'makepl_arg' => q[PREFIX=~/lib],

当我尝试运行test.pl脚本时:

$perl test.pl

#!/usr/bin/perl

use lib "/homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi";

use Text::CSV_XS;

print "test";

我明白了

Can't load '/homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/Text/CSV_XS/CSV_XS.so' for module Text::CSV_XS: /homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/Text/CSV_XS/CSV_XS.so: cannot open shared object file: No such file or directory at /www/common/perl/lib/5.8.2/i686-linux/DynaLoader.pm line 229.
at test.pl line 6
Compilation failed in require at test.pl line 6.
BEGIN failed--compilation aborted at test.pl line 6.

我将错误追溯到DynaLoader.pm它发生在这一行:

# Many dynamic extension loading problems will appear to come from
# this section of code: XYZ failed at line 123 of DynaLoader.pm.
# Often these errors are actually occurring in the initialisation
# C code of the extension XS file. Perl reports the error as being
# in this perl code simply because this was the last perl code
# it executed.

my $libref = dl_load_file($file,$module->dl_load_flags) or
    croak("Can't load '$file' for module $module: ".dl_error());

CSV_XS.so存在于上述目录中

解决方法

我个人建议使用 local::lib.

(编辑:李大同)

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

    推荐文章
      热点阅读