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.

Tim
  • 13,904
  • 10
  • 69
  • 101

2 Answers2

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.

ikegami
  • 367,544
  • 15
  • 269
  • 518
-1

Alternatively you can use :

use lib /my/other/direcotry 

or

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

to change the value of @INC.

biegleux
  • 13,179
  • 11
  • 45
  • 52
Dibyajyoti
  • 71
  • 4