Search code examples
macosperl-moduleosx-elcapitan

Perl error: Can't locate module in @INC El Capitan


I upgraded to OS X El Capitan and now I can't run a perl script which was working without any problem before. After running the script I get:

Can't locate PDL.pm in @INC (you may need to install the PDL module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .)

Does anyone know how to fix it?


Solution

  • If you use the system perl your perl version was updated when upgrading to El Capitan. OS X does not automatically reinstall all your modules on the new version of perl, you'll have to do it yourself. So you'd need to re-install PDL.

    By the way, OS X also keeps a version of perl 5.16 available, it might still have PDL installed. If you run /usr/bin/perl5.16 myscript.pl you might find PDL still existing for that perl.