Problems executing perl on git for windows bash

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

ffuentes

Posted 2018-08-09T22:13:24.260

Reputation: 171

Install Text::CSV module. – Toto – 2018-08-10T08:10:36.383

1I have it. On Windows it runs fine but I wanted to run it on Windows – ffuentes – 2018-08-10T08:33:39.850

Answers

3

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.

ffuentes

Posted 2018-08-09T22:13:24.260

Reputation: 171

2I had to also include site in there: export PERL5LIB=/c/Strawberry/perl/vendor/lib:/c/Strawberry/perl/site/lib – Pod – 2018-10-30T12:37:23.543