4

The issue is that perl is installed in my system and bash can see it, however when I try to execute a perl script that includes a module, there's an error.

Can't locate Text/CSV.pm in @INC (you may need to install the Text::CSV module) (@INC contains: /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at parse_prospects.pl line 5. BEGIN failed--compilation aborted at parse_prospects.pl line 5.

On CMD there's no such error so I wonder what I'd have to do to make them compatible. It's like perl on bash thinks it's on Linux and tries to find his packages on /usr/share

2
  • Install Text::CSV module.
    – Toto
    Aug 10, 2018 at 8:10
  • 1
    I have it. On Windows it runs fine but I wanted to run it on Windows
    – ffuentes
    Aug 10, 2018 at 8:33

1 Answer 1

4

I was using Strawberry Perl so if you have that one and want to use Perl on MSYS2 or Git for Windows you have to specify an ENV variable called PERL5LIB with the route to your modules on Strawberry Perl or the Perl distribution you have. .

 export PERL5LIB=/c/Strawberry/perl/vendor/lib

which to be permanent on your system has to be located on your .bashrc in your home route. That way both CMD and bash will use the same modules.

1
  • 3
    I had to also include site in there: export PERL5LIB=/c/Strawberry/perl/vendor/lib:/c/Strawberry/perl/site/lib
    – Pod
    Oct 30, 2018 at 12:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .