Perl on Mac OS 10.10 Yosemite with the strange @INC path

After upgrading to OS 10.10, I had to install all the old used perl modules again. No problems. I thought.

Perl on OS 10.10: "This is perl 5, version 16, subversion 3 (v5.16.3), built for darwin-thread-multi-2level" (from perl -version). It seems like @INC (try perl -e 'print join ("\ n", @INC);' or perl -V):

/opt/local/lib/perl5/site_perl/5.16.3/darwin-thread-multi-2level / opt / local / lib / perl 5 / site_perl / 5.16.3 / opt / local / lib / perl 5 / vendor_perl / 5.16 .3 / darwin-thread-multi-2level / opt / local / lib / perl 5 / vendor_perl / 5.16.3 / opt / local / lib / perl 5 / 5.16.3 / darwin-thread-multi-2level / opt / local / lib / perl 5 / 5.16.3 / opt / local / library / perl5 / site_perl / opt / local / library / perl5 / vendor_perl

When I try to use an unknown module, perl throws: "Cannot find Mymodule.pm in @INC ... and then: @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 and all other well-known (and added folders on 5.18 perl.pm). Every perl developer knows this message. But read literally: @INC links are obviously in 5.18 folders! And at first glance I should use Perl 5.18.

I installed my first group of new modules from Macports. 5.18 portfolios. And he added new module templates to the list / Library / Perl / 5.18 / AppendToPath. It works well. But when I installed the module, unavailable as 5.18 in Macports, using cpan I had problems. The module was compiled with 5.16 (of course, see above) and was not accepted as another path in the AppendToPath file. Dynamic bootloader mismatch.

I don't know where the @INC list changes at runtime. In earlier versions of Mac OS 10, the new version of @INC included version module versions. That is, active perl 5.14 also included 5.14 modules, 5.12 included 5.12 aso patches Why does perl 5.16 on Yosemite include 5.18 modules?


: $^ V , 5.18. , , . , shebang #!/Usr/bin/perl 5.18, 5.16.

+4
2

OS Yosemite Maverick perl 5.16 5.18. which perl /opt/local/bin/perl, /opt/local/bin/perl5.16.

#!/usr/bin/perl shebang perl- (, Linux), perl, #!/usr/bin/perl 5.18.

cpan/cpanm (cpanminus) , , 5.16. / (. ).

cpanm /opt/local/libexec/perl5.16/sitebin/ /opt/local/libexec/perl5.18/, sitebin no cpanm.

: sitebin /opt/local/libexec/perl5.18/ /opt/local/libexec/perl5.16/sitebin/cpanm /opt/local/libexec/perl5.18/sitebin/ ( sudo... ).

cpanm perl, , shebang !

#!/opt/local/bin/perl5.16 
eval 'exec /opt/local/bin/perl5.16  -S $0 ${1+"$@"}'

#!/opt/local/bin/perl5.18 
eval 'exec /opt/local/bin/perl5.18  -S $0 ${1+"$@"}'

: 5.16 5.18. .

cpanm. cpanm /opt/local/lib/perl5/site_perl/5.18/darwin-thread-multi-2level/. perl 5.18 Mac, /Library/perl/5.18/AppendToPath /opt/local/lib/perl5/site_perl/5.18/darwin-thread-multi-2level ( ).

.

+3

Perl perl. , , , . , perl .

Macports homebrew , Perl. /opt/local/version PATH .

. Xcode Command Line Tools. perlbrew. perl. , 6 - . , . . , , , , perlbrew . , .

+3

All Articles