4

特定のシステムで、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.

次に、cygwin の lib の下で Util を検索したところ、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

だから今、私は混乱しています。List::Util は標準の perl ディストリビューションの一部ではありませんか? 私の混乱の理由

  1. List/Util.pm は i686-cygwin の下にあります
  2. ActiveSync のインストールに List/Util.pm がありませんでした
4

2 に答える 2

12

List::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

于 2012-01-01T18:18:15.553 に答える
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のパスは@INC他のperlバージョンのものではありません。それらはおそらく別々のインストールであるため、ライブラリを共有しません。

ActiveState perlを更新すれば、すべてうまくいくはずです。

于 2012-01-01T18:23:10.183 に答える