How to change @INC in Strawberry Perl?

一曲冷凌霜 提交于 2019-12-07 02:30:40

问题


How can I change @INC permanently, without changing my scripts, in Strawberry Perl?

I'm aware of -I, but don't want to invoke that switch every time.


回答1:


To prepend paths, set environment variable PERL5LIB to those paths.

Note: This will affect all installations of Perl you run when this is effect.

Howto: Right-click (My) Computer, Properties, Advanced, Environment Variables, (the top) New. You will probably have to restart already running consoles to get the change.




回答2:


Alternatively you can use :

use lib /my/other/direcotry 

or

push (@INC , /my/other/direcotry)

to change the value of @INC.



来源:https://stackoverflow.com/questions/5806126/how-to-change-inc-in-strawberry-perl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!