开发者

site and site\lib directory locations for Perl on Windows

I am a PHP programmer and have just been assigned task to work on some Perls stuf开发者_如何转开发f - I need to install modules.

But can anybody clarify for me the difference between 'lib' and 'site\lib' when install modules. By what criterion is one module installed in one instead of the other?

Is this really relevant on Windows (sorry never worked on UNIX).

I am looking at using Strawberry Perl 5.12.2.0.


lib/ contains the modules that come with Perl. site/lib/ contains the module you've installed yourself. Perl itself doesn't make any distinction between the two.

If site/lib/ isn't empty for a fresh install, it's probably because Strawberry includes modules in their distro that aren't normally packaged with Perl. (I know ActivePerl does.)


SOmetimes it is relevant. Sometimes you have to set the env var PERL5LIB to "site\lib;lib", sometimes it's the other way around.

Example (valid as of April, 2011):

Perl 5.12 includes Try::Tiny 0.6.

If you were to install Test::Fatal, it wants Try::Tiny 0.7+.

So you have to update it from the CPAN: then you'd get Try::Tiny 0.09

but 0.09 will only get loaded when you tell perl to look in site\lib first.


The most recent Strawberry Perl named: strawberry-perl-5.28.1.1-64bit-portable, show the locations specified by @INC to be:

  @INC:
    D:/myBuilds/strawberry-perl-5.28.1.1-64bit-portable/perl/site/lib
    D:/myBuilds/strawberry-perl-5.28.1.1-64bit-portable/perl/vendor/lib
    D:/myBuilds/strawberry-perl-5.28.1.1-64bit-portable/perl/lib

What goes into vendor... is still unknown...
(Feel free to edit this.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜