Not on the list :: Recycling a standard Perl distribution?

On a specific system, I run a perl script and it fails saying

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.

Now the weird part is that before deploying the code to the faulty system, I ran it on my laptop and it just worked fine. The difference in both systems is that on my laptop I use Cygwin, and it includes the perl package, and the indicated failed ActiveState perl system.

 <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. 

Then I searched Util under cygwin lib and was present in 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 

So now I'm embarrassed. Isn; t List :: Util part of the standard perl distribution? Reason for my confusion

  • List /Util.pm present in i686-cygwin
  • ActiveSync installation did not have List / Util.pm
+4
source share
2 answers

The :: Util list was added only to the kernel in 5.7 (development version), and the first stable perl version containing List :: Util was 5.8.0. So, although it is on the perl 5.10 distribution you installed under cygwin, the perl 5.6.1 executable ActiveState that you called does not have it. You must upgrade ActiveState perl to at least 5.8.0, and then you will have the required module.

Here is a link to find all versions of perl containing the main module: http://perlpunks.de/corelist/version?module=List%3A%3AUtil

+12
source

When I check corelist , I get:

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

Your version of perl looks like 5.6.1, in which case List::Util will not be part of the basic installation.

Judging by the path c:\cygwin\lib\perl5\5.10 , it seems that your version of cygwin is at least 5.10, but as you noticed, the cygwin path is not in @INC your other version of perl. These are most likely separate installations, and therefore they do not share libraries.

Update Perl ActiveState and everything should be fine.

+10
source

Source: https://habr.com/ru/post/1388822/


All Articles