Perl on Mac OS 10.10 Yosemite with strange @INC path -
Perl on Mac OS 10.10 Yosemite with strange @INC path -
after upgrading os 10.10 had install former used perl modules again. no problem. thought.
perl on os 10.10 "this perl 5, version 16, subversion 3 (v5.16.3) built darwin-thread-multi-2level" (from perl --version). @inc looks (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/perl5/site_perl/5.16.3 /opt/local/lib/perl5/vendor_perl/5.16.3/darwin-thread-multi-2level /opt/local/lib/perl5/vendor_perl/5.16.3 /opt/local/lib/perl5/5.16.3/darwin-thread-multi-2level /opt/local/lib/perl5/5.16.3 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl
when seek utilize unknown module, perl throws: "can't locate mymodule.pm in @inc ... , 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 , other known (and added 5.18 perl.pm folders). every perl dev knows message. read literally: @inc links 5.18 folders ! , @ first glance supposed utilize perl 5.18.
i installed first bunch of new modules macports. 5.18 portfiles. , added new module pathes list /library/perl/5.18/appendtopath. worked well. when installed module - not available 5.18 in macports - cpan, got trouble. module compiled 5.16 (of course, see above) , not accepted other path in appendtopath file. dynaloader mismatch.
i not know, @inc list altered @ runtime. in before mac os 10 versions, new @inc included same version module versions. i.e. active perl 5.14 included 5.14 modules, 5.12 included 5.12 pathes a.s.o. why perl 5.16 on yosemite include 5.18 module pathes ?
to add together confusion after post: when seek print $^v in programme code, 5.18. means, don't meant get. may shebang #!/usr/bin/perl starts 5.18 , not 5.16.
experienced perl developers tell ignore scheme perl. if upgrade it, bugfix need, run risk of breaking os. if upgrade os, modified scheme perl may break code.
macports , homebrew both great, not ideal perl. i'd clear /opt/local/version path, or system.
do big favor. install xcode
command line tools
. install perlbrew
. roll own perl. heck, roll 6 of own perls , jump , forth between them. maintain threaded version around when need it. maintain non-threaded around speed. best of all, whenever alter version using, perlbrew updates environment correctly you. no fuss, no muss.
perl osx-yosemite
Comments
Post a Comment