我正在运行 Centos 6.4 和 perl 5.10。我有使用该DateTime
模块的简短脚本。但是,当我运行我的脚本时,我收到以下错误消息,告诉我无法找到各种模块,因为它们不在库路径中。
Can't locate Params/Validate.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/lib64/perl5/DateTime/Duration.pm line 11.
BEGIN failed--compilation aborted at /usr/lib64/perl5/DateTime/Duration.pm line 11.
Compilation failed in require at /usr/lib64/perl5/DateTime.pm line 45.
BEGIN failed--compilation aborted at /usr/lib64/perl5/DateTime.pm line 45.
Compilation failed in require at ./jr_fix_western_filestore.perl line 39.
BEGIN failed--compilation aborted at ./jr_fix_western_filestore.perl line 39.
所有这些软件包都是通过 yum 安装的。例如yum install perl-Params-Validate.x86_64
和yum install perl-DateTime.x86_64
。yum install 不应该将这些模块放在@INC 中吗?
我也尝试通过 cpan 安装软件包,但这似乎想先下载很多依赖项,并且不可避免地会失败。
CPAN.pm: Going to build D/DR/DROLSKY/DateTime-1.03.tar.gz
Can't locate Module/Build.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Build.PL line 5.
BEGIN failed--compilation aborted at Build.PL line 5.
Warning: No success on command[/usr/bin/perl Build.PL --installdirs site]
Warning (usually harmless): 'YAML' not installed, will not store persistent state
DROLSKY/DateTime-1.03.tar.gz
/usr/bin/perl Build.PL --installdirs site -- NOT OK
Running Build test
Make had some problems, won't test
Running Build install
Make had some problems, won't install
Could not read '/root/.cpan/build/DateTime-1.03-Brpqo5/META.yml'. Falling back to other methods to determine prerequisites
Warning: CPAN.pm discovered Module::Build as undeclared prerequisite.
Adding it now as such.
当我尝试在 cpan 中安装 Module::Build 时,出现以下错误
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
OVID/Test-Harness-3.28.tar.gz : make_test NO
MSCHWERN/Test-Simple-0.98.tar.gz : make_test NO
JPEACOCK/version-0.9902.tar.gz : make_test NO
BOBTFISH/Module-Metadata-1.000014.tar.gz : make_test NO
DAGOLDEN/CPAN-Meta-YAML-0.008.tar.gz : make_test NO
MAKAMAKA/JSON-PP-2.27202.tar.gz : make_test NO
DAGOLDEN/Parse-CPAN-Meta-1.4404.tar.gz : make_test NO
DAGOLDEN/CPAN-Meta-Requirements-2.122.tar.gz : make_test NO
DAGOLDEN/CPAN-Meta-2.130880.tar.gz : make_test NO
DAGOLDEN/Perl-OSType-1.003.tar.gz : make_test NO
JESSE/Locale-Maketext-Simple-0.21.tar.gz : make_test NO
BINGOS/Params-Check-0.36.tar.gz : make_test NO
BINGOS/Module-Load-0.24.tar.gz : make_test NO
BINGOS/Module-CoreList-2.91.tar.gz : make_test NO
BINGOS/Module-Load-Conditional-0.54.tar.gz : make_test NO
BINGOS/IPC-Cmd-0.80.tar.gz : make_test NO
DAGOLDEN/ExtUtils-CBuilder-0.280205.tar.gz : make_test NO
LEONT/Module-Build-0.4005.tar.gz : make NO
任何指针?
rpm -ql perl-Params-Validate
返回
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Attribute
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Attribute/Params
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Attribute/Params/Validate.pm
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Params
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Params/Validate.pm
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Params/ValidatePP.pm
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Params/ValidateXS.pm
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/auto/Params
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/auto/Params/Validate
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/auto/Params/Validate/Validate.bs
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/auto/Params/Validate/Validate.so
/usr/share/doc/perl-Params-Validate-0.95
/usr/share/doc/perl-Params-Validate-0.95/Changes
/usr/share/doc/perl-Params-Validate-0.95/LICENSE
/usr/share/doc/perl-Params-Validate-0.95/MANIFEST
/usr/share/doc/perl-Params-Validate-0.95/META.yml
/usr/share/doc/perl-Params-Validate-0.95/README
/usr/share/doc/perl-Params-Validate-0.95/TODO
/usr/share/man/man3/Attribute::Params::Validate.3pm.gz
/usr/share/man/man3/Params::Validate.3pm.gz
/usr/share/man/man3/Params::ValidatePP.3pm.gz
/usr/share/man/man3/Params::ValidateXS.3pm.gz
我不确定@INC 是否搜索了这些路径
但是locate Validate.pm
什么也不返回