Search code examples
perlperl-module

Using custom modules in PERL


I made myself a custom PERL module and it works when called by a script in the same directory, but not from outside the directory for somewhat obvious reasons. How do I use the module without installing it? eg:

use 5.012;
use warnings;
use Y:/my/dir/to/module.pm;

Solution

  • use lib 'Y:/my/dir/to';
    use module; # BAD name for module, lowercase is reserved for pragmas...