How to change @INC in Strawberry Perl?
Asked Answered
J

2

7

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.

Jauch answered 27/4, 2011 at 14:54 Comment(0)
C
13

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.

Conferva answered 27/4, 2011 at 15:3 Comment(0)
N
-1

Alternatively you can use :

use lib /my/other/direcotry 

or

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

to change the value of @INC.

Natasha answered 8/8, 2012 at 8:17 Comment(1)
That would require me to edit my scripts or their invocations, though.Jauch

© 2022 - 2024 — McMap. All rights reserved.