Forums.ATC.no

Teknisk => Generelt teknisk => Emne startet av: ATC på 27. ſeptember 2008, 18:24 pm

Tittel: Perl: How to use modules in a custom directory
Skrevet av: ATC27. ſeptember 2008, 18:24 pm
When trying to "use" modules in a custom directory, perl says it can't find the module in any of the directories in @INC.

If I try to manually add the directory to @INC, perl seems to ignore it.
Tittel: [Solved] Perl: How to use modules in a custom directory
Skrevet av: ATC27. ſeptember 2008, 18:24 pm
Modules are actually "used" by perl when the script is parsed, now while it is running. This means that any changes to @INC at runtime will happen only AFTER perl searches for the modules to use.

Instead, a "lib" pragma exists for this purpose. To use Custom.pm:
use lib "/my/module/directory"
use Custom;