我一直在寻找一个奇怪的问题,但无法弄清楚原因。
我正在尝试使用Nagiosplugin check_esx3检查ESXi主机
每当我调用脚本时,我得到一个正确的返回,但是在我得到错误之前,如下所示:
Number found where operator expected at /usr/local/lib/perl/5.14.2/Encode/ConfigLocal.pm line 13, near "$_ModLines_
1"
(Missing semicolon on previous line?)
由于与Perl的任何其他交互都会遇到相同的场景,因此它的迁移是最基本的。不幸的是,我并不熟悉Perl。
试着打电话给“enc2xs -C”我得到:
Number found where operator expected at /usr/local/lib/perl/5.14.2/Encode/ConfigLocal.pm line 13, near "$_ModLines_
1"
(Missing semicolon on previous line?)
require Encode;
require Encode;
require Encode::Symbol;
require Encode::Byte;
require Encode::Config;
require Encode::Encoder;
require Encode::EBCDIC;
require Encode::Alias;
require Encode::ConfigLocal;
Can't require Encode::ConfigLocal: Attempt to reload Encode/ConfigLocal.pm aborted.
Compilation failed in require at (eval 16) line 1.
/usr/local/lib/perl/5.14.2/Encode/ConfigLocal.pm的内容:
#
# Local demand-load module list
#
# You should not edit this file by hand! use "enc2xs -C"
#
package Encode::ConfigLocal;
our $VERSION = $_LocalVer_;
use strict;
$_ModLines_
1;
Perlversion信息:
Built under linux
Compiled at Sep 30 2013 03:45:34
%ENV:
PERL_LWP_SSL_VERIFY_HOSTNAME="0"
@INC:
/etc/perl
/usr/local/lib/perl/5.14.2
/usr/local/share/perl/5.14.2
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.14
/usr/share/perl/5.14
/usr/local/lib/site_perl
.
答案 0 :(得分:1)
只需删除/usr/local/lib/perl/5.14.2/Encode/ConfigLocal.pm
即可。它是可选的(参见Encode.pm
的源代码,require Encode::ConfigLocal
包含在eval块中),而不是普通perl安装的一部分。 enc2xs -C
会创建一个新的Encode::ConfigLocal
,但显然存在一个创建无效文件的错误。无论如何,除非你真的认为你需要它,否则就把它移除。
答案 1 :(得分:0)
如错误消息中所述,前一行缺少分号:
package Encode::ConfigLocal;
our $VERSION = $_LocalVer_;
use strict;
$_ModLines_;
# here __^
1;