0

I have strawberry perl installed in my C drive in windows and running a build from an existing big project. During the build there are some perl build scripts that needs to be executed and in the it throws the below error message:

enter image description here

Below are the results of the commands I gave for verifying the existence of XML::Simple

enter image description here

I am wondering about the path /usr/local/lib in windows and perl is installed in C:\Strawberry\perl\bin and XML::Simple is in C:\Strawberry\perl\vendor\lib\XML and C:\Strawberry\perl\lib\XML.

EDIT: Output from perl -V. I have kept only for @INC

Built under MSWin32 Compiled at Aug 2 2020 19:51:20 @INC:

C:/Strawberry/perl/site/lib
C:/Strawberry/perl/vendor/lib
C:/Strawberry/perl/lib
jxgn
  • 741
  • 2
  • 15
  • 36

1 Answers1

1

It looks like the two situations are using different perl binaries with different library paths. When you run perl or cpan, you are using Strawberry Perl. Whatever you are doing at the top is likely using a different perl, perhaps from cygwin.

You need to install modules with the perl that wants to use them. Find the cpan for that perl (perhaps look in the Makefile to see how its finding perl, and cpan should be in the same directory).

Update your answer with the (text) output of perl -V. At the end of that output it will show the @INC directories. I'm guessing that list doesn't match the top image.

brian d foy
  • 129,424
  • 31
  • 207
  • 592
  • Thanks for your response. Yes I understand it is taking from another path and that's why I am wondering about this /usr/local/... and /user/lib/... paths in my Windows machine (PS: I have ubuntu app installed from the store). As requested I have updated with perl -V output for @INC. – jxgn Nov 06 '20 at 05:53
  • I removed the cygwin from my environment path. Now it is taking properly and my build is running fine. Thanks for the quick support. – jxgn Nov 06 '20 at 06:21
  • Normally, using the `cpan` from the correct `perl` is good enough. With the `cpan` that comes with SP, you have to make sure the correct `perl` comes first in the path (or use the more arcane `perl -MCPAN::Shell ...` approach) – ikegami Nov 06 '20 at 13:16