如何在 perl 中使用最新库编辑 INC

如何在 perl 中使用最新库编辑 INC

运行 Perl 脚本时如何避免以下错误?

Can't locate YAML/XS.pm in @INC (@INC contains: ../../../YAML-LibYAML-0.35/blib/lib/YAML/XS.pm /app/utp/utp/apps_oper/perl5lib ../../../3rdparty/YAML-LibYAML-0.35/blib/lib ../../../3rdparty/YAML-LibYAML-0.35/blib/arch ../../../perl ../../adhoc/perl ../../api/perl ../../3rdparty/YAML-LibYAML-0.35/blib/lib ../../3rdparty/YAML-LibYAML-0.35/blib/arch ./common ../../adhoc/perl ../../api/perl ../../../3rdparty/YAML-LibYAML-0.35/blib/lib ../../../3rdparty/YAML-LibYAML-0.35/blib/arch ./common ../../adhoc/perl ../../api/perl /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at common/FixMessageData.pm line 32.
BEGIN failed--compilation aborted at common/FixMessageData.pm line 32.
Compilation failed in require at common/OrderGenSessionFact.pm line 32.
BEGIN failed--compilation aborted at common/OrderGenSessionFact.pm line 32.
Compilation failed in require at OrderGenSessionClient.pl line 21.
BEGIN failed--compilation aborted at OrderGenSessionClient.pl line 21.

答案1

丢失的YAML/XS.pm是包裹的一部分libyaml-libyaml-perl

因此通过以下方式安装:

 sudo apt-get install libyaml-libyaml-perl

我为什么知道这个?

% apt-file search YAML/XS.pm
libyaml-libyaml-perl: /usr/lib/x86_64-linux-gnu/perl5/5.20/YAML/XS.pm

相关内容