Perl 在@INC中找不到scripts/Config.pm(您可能需要安装scripts::Config模块)

Perl 在@INC中找不到scripts/Config.pm(您可能需要安装scripts::Config模块),perl,Perl,为便于阅读,增加了换行符 我尝试使用cpan安装脚本::Config安装模块,但它不起作用 Can't locate scripts/Config.pm in @INC (you may need to install the scripts::Config module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1

为便于阅读,增加了换行符

我尝试使用cpan安装脚本::Config安装模块,但它不起作用

Can't locate scripts/Config.pm in @INC
(you may need to install the scripts::Config module)
(@INC contains:
    /etc/perl
    /usr/local/lib/x86_64-linux-gnu/perl/5.24.1
    /usr/local/share/perl/5.24.1
    /usr/lib/x86_64-linux-gnu/perl5/5.24
    /usr/share/perl5
    /usr/lib/x86_64-linux-gnu/perl/5.24
    /usr/share/perl/5.24
    /usr/local/lib/site_perl
    /usr/lib/x86_64-linux-gnu/perl-base
) at scripts/Training.pl line 54.
我试图在/usr/local中创建链接,但该链接为空:

Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/home/japangly/.cpan/Metadata'
  Database was generated on Thu, 03 Jan 2019 13:29:03 GMT
Warning: Cannot install scripts::Config, don't know what it is.
Try the command
    i /scripts::Config/
to find objects with matching identifiers.
我使用谷歌云平台:

$perl/usr/bin/perl

$perl-e print join\\n\,@INC

ln -s /usr/{,local/}lib/perl5/5.8.3

ln -s /usr/{,local/}lib/perl5/site_perl/5.8.3
错误消息是:

找不到scripts/Config.pm。。。在scripts/Training.pl第54行

第53行和第54行看起来像

/etc/perl
/usr/local/lib/x86_64-linux-gnu/perl/5.24.1
/usr/local/share/perl/5.24.1
/usr/lib/x86_64-linux-gnu/perl5/5.24
/usr/share/perl5
/usr/lib/x86_64-linux-gnu/perl/5.24
/usr/share/perl/5.24
/usr/local/lib/site_perl
/usr/lib/x86_64-linux-gnu/perl-base
错误消息是:

找不到scripts/Config.pm。。。在scripts/Training.pl第54行

第53行和第54行看起来像

/etc/perl
/usr/local/lib/x86_64-linux-gnu/perl/5.24.1
/usr/local/share/perl/5.24.1
/usr/lib/x86_64-linux-gnu/perl5/5.24
/usr/share/perl5
/usr/lib/x86_64-linux-gnu/perl/5.24
/usr/share/perl/5.24
/usr/local/lib/site_perl
/usr/lib/x86_64-linux-gnu/perl-base

找不到scripts/Config.pm。。。在scripts/Training.pl-请向我们展示scripts/Training.pl的样子。也许您只是缺少了行use lib'.'和'scripts';在Training.pl中,或者您从错误的目录启动Training.pl。$|=1;如果@ARGV<1{打印用法:Training.pl Config.pm\n;exit0;}加载配置变量需要$ARGV[0];第54Ah行-因此您的脚本希望从Config.pm所在的目录运行。找不到scripts/Config.pm。。。在scripts/Training.pl-请向我们展示scripts/Training.pl的样子。也许您只是缺少了行use lib'.'和'scripts';在Training.pl中,或者您从错误的目录启动Training.pl。$|=1;如果@ARGV<1{打印用法:Training.pl Config.pm\n;exit0;}加载配置变量需要$ARGV[0];第54Ah行-因此您的脚本希望从Config.pm所在的目录运行。查找与当前目录相关的模块太奇怪了。我正要提交一个使用$RealBin而不是.,但是的编辑。实际上是正确的黑客在这里。正确的解决方法是使用do“/”。$path而不是do$path放弃使用@INC。这仍然会留下将代码用作数据的安全漏洞。@ikegami$RealBin可能是更可取的方法,但我不知道脚本和运行环境,所以。似乎侵入性较小。还是…哇。查找与当前目录相关的模块太奇怪了。我正要提交一个使用$RealBin而不是.,但是的编辑。实际上是正确的黑客在这里。正确的解决方法是使用do“/”。$path而不是do$path放弃使用@INC。这仍然会留下将代码用作数据的安全漏洞。@ikegami$RealBin可能是更可取的方法,但我不知道脚本和运行环境,所以。似乎侵入性较小。还
use lib '.';