2
votes

I need to use the MSYS Perl to be able to install autoconf on my MSYS2 on Windows 7 because ActivePerl or Strawberry Perl don't work for the autoconf installation. The only problem is the default installation of MSYS Perl doesn't seem to include some basic modules such as strict or Carp. When I make autoconf it gives:

Can't locate Carp.pm in @INC (you may need to install the Carp module) (@INC contains: ../lib /usr/local/perl-5.22.1/lib/perl5/core_perl /usr/local/perl-5.22.1/lib/perl5/site_perl /usr/local/perl-5.22.1/lib/perl5/vendor_perl

When I try to do a manual installation of Carp, during the perl Makefile.PL step I get:

Can't locate warnings.pm in @INC

The problem is, in order to install the warnings.pm I need to have installed the basic set of modules such as strict but those modules don't seem to be present in the core modules directory /usr/local/perl-5.22.1/lib/perl5/core_perl

How can I install those basic modules for my MSYS Perl?

1
Just my $0.02, but /usr/local/ doesn't sound like you are calling /usr/bin/perl.exe from the MSYS2 Perl package... - Stefan Becker
FYI: when printing @INC under MSYS2 on my WIndows 10 machine I only get paths under /usr/lib/perl5 and /usr/share/perl5. - Stefan Becker
@StefanBecker Thank you for the comment. I have installed the MSYS Perl into a new directoryunder /usr/local on purpose in order to be able to switch to the ActiveState's Perl when I need to. And I defined this new Perl into MSYS's .bash_profile like so export PERL5=/usr/local/perl-5.22.1 && PATH=$PATH:$PERL5/bin and I of course erased the ActiveState's Perl path from Windows System Environment Variables. This setup works quite fine under the MSYS environment. - Terry
To define the Perl modules' directory I entered those lines into ~/.bash_profile export PERL5LIB=$PERL5/lib/perl5/vendor_perl"${PERL5LIB:+:$PERL5LIB}" export PERL5LIB=$PERL5/lib/perl5/site_perl"${PERL5LIB:+:$PERL5LIB}" export PERL5LIB=$PERL5/lib/perl5/core_perl"${PERL5LIB:+:$PERL5LIB}" and that seems to work fine too. - Terry
@Romario: if your "requirement to switch" is static, how about installing msys2 perl package with pacman and then making /usr/bin/perl a symlink that you can switch? You might even want to look into using alternatives system for that. - Stefan Becker

1 Answers

1
votes

This is how I install your perl module in msys2:

$ pacman -S perl-Carp-Clan

Here is a full list of the perl packages available for msys2:

https://packages.msys2.org/group/perl-modules