2012-01-01 31 views
4

在一个特定的系统,我运行一个perl脚本,它说不是List :: Util标准Perl分发的一部分吗?

Can't locate List/Util.pm in @INC (@INC contains: <Some-Path>/ActiveState/perl/lib <Some-Path>/ActiveState/perl/site/lib .) at <Some-Other-Path>\searchCobolPgms.ps line 7.

没有现在奇怪的部分是,部署代码到失败的系统之前,我跑在我的笔记本电脑,它运行良好。这两个系统的区别在于,在我的笔记本电脑中,我使用的是Cygwin,并且perl与它捆绑在一起,并且所述失败的系统具有ActiveState perl

<Some-Path>perl -v 

This is perl, v5.6.1 built for MSWin32-x86-multi-thread 
(with 1 registered patch, see perl -V for more detail) 

Copyright 1987-2001, Larry Wall 

Binary build 635 provided by ActiveState Corp. http://www.ActiveState.com 
Built 15:34:21 Feb 4 2003 


Perl may be copied only under the terms of either the Artistic License or the 
GNU General Public License, which may be found in the Perl 5 source kit. 

Complete documentation for Perl, including FAQ lists, should be found on 
this system using `man perl' or `perldoc perl'. If you have access to the 
Internet, point your browser at http://www.perl.com/, the Perl Home Page. 

我接着又搜寻的Util的cygwin的lib下,它在为i686-cygwin的

c:\cygwin\lib\perl5\5.10>find . -name Util.pm 
./CGI/Util.pm 
./i686-cygwin/Hash/Util.pm 
./i686-cygwin/List/Util.pm 
./i686-cygwin/Scalar/Util.pm 

所以现在我很困惑出席了会议。 Isn; t List :: Util是标准perl发行版的一部分吗? 对我的困惑

  1. 名单的原因/ Util.pm正在为i686-cygwin的
  2. ActiveSync安装中没有列出本/ Util.pm
+2

我怀疑你使用的古代版本的Perl不包括它。它并不总是核心库的一部分。 – 2012-01-01 18:19:39

+0

@BrianRoach,是的,你的猜测是正确的。那就是问题所在。 – Abhijit 2012-01-01 18:36:22

+0

Perl 5.6.1已超过十年。请更新为更新的内容。我建议草莓Perl - http://strawberryperl.com/ – 2012-01-03 10:07:52

回答

12

名单::的Util才被加入到核心在5.7(一个开发版本),包含List :: Util的perl的第一个稳定版本是5.8.0。因此,虽然它已安装在cygwin下的perl 5.10发行版中,但您所调用的perl 5.6.1 ActiveState可执行文件没有它。你应该更新ActiveState perl至少5.8.0,然后它将会有你需要的模块。

下面是查找包含核心模块的Perl的所有版本的链接:http://perlpunks.de/corelist/version?module=List%3A%3AUtil

+1

谢谢。这对我来说很有意义。不幸的是,我不能更新ActiveState perl,因为这意味着我必须从整个认证链中除去整个法律和版权过程。所以这意味着我必须最终将脚本更改为不使用List :: Util。再次感谢链接:-) – Abhijit 2012-01-01 18:33:51

+0

那么,你也可以在不更新ActiveState的情况下安装List :: Util。在CPAN的版本1.23_03上有一个名为Scalar-List-Utils的软件包,它似乎与perl 5.6兼容,并在自述文件中列出了一条警告:http://cpansearch.perl.org/src/GBARR/Scalar-List -Utils-1。23_03/README - 在至少它是需要通过法律部门得到的东西少量:) – Dan 2012-01-01 18:56:33

+0

但也没有理由你不能找到一个真正的老版本列表::的Util原打算安装perl 5.6。 List :: Util 1.06_00是添加到内核的版本,因此之前的任何内容都打算安装在perl 5.6上。您可以从http://backpan.perl.org/authors/id/G/GB/GBARR/ – Dan 2012-01-01 19:00:44

10

当我检查corelist我得到:

corelist List::Util 
List::Util was first released with perl v5.7.3 

你的perl版本似乎是5.6.1,在这种情况下List::Util不会成为核心安装的一部分。

通过路径c:\cygwin\lib\perl5\5.10来判断,看起来你的cygwin版本至少是5.10,但是你会注意到,cygwin路径不在你其他perl版本的@INC。它们很可能是单独的安装,因此它们不共享库。

更新你的ActiveState perl,一切都会好的。

+0

获得BackPAN的所有软件包版本,谢谢TLP。现在确实对我有意义。我刚刚从DAN那里得到了这个链接,它将帮助我进行兼容性编码:-) – Abhijit 2012-01-01 18:35:38

相关问题