我试图在 Ubuntu 14.04.02 LTS 上运行 Perl 脚本。该脚本如下所示:
#!/usr/bin/perl5.18.2
use warnings;
use strict;
use XML::Simple qw(:strict);
use Net::Telnet();
Run Code Online (Sandbox Code Playgroud)
我在命令行上得到以下信息:
在@INC 中找不到 XML/Simple.pm(您可能需要安装 XML::Simple 模块) (@INC 包含:/usr/share/perl5/ /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) 在 RR_2_668.pl 第 16 行。 BEGIN 失败——编译在 RR_2_668.pl 第 16 行中止。
XML::Simple 位于第 16 行。为简洁起见,我删除了中间的所有注释行并删除了后面的附加代码。我进行了搜索,Simple.pm 似乎在系统上:
/usr/share/perl5/IPC/System/Simple.pm /usr/share/perl5/Lintian/Command/Simple.pm /usr/share/perl5/Log/Message/Simple.pm /usr/share/perl/5.18.2/Locale/Maketext/Simple.pm /usr/share/perl/5.18.2/Pod/Simple.pm /usr/share/perl/5.18.2/Test/Simple.pm /usr/share/perl/5.18.2/Filter/Simple.pm /usr/share/perl/5.18.2/Log/Message/Simple.pm
有没有办法让我的脚本看到其中一个?