yeah, but it would look like
use lib '/some/path/to/local/modules';
# /some/path/to/local/modules/Some/Module.pm
use Some::Module;
you can install perl modules in that directory with
perl Makefile.PL PREFIX="/some/path/to/local/modules/" | [reply] [d/l] [select] |
I assume that by "method" you mean "module". In theory, you can "use lib", but in general, you shouldn't assume that anything will work without installing (or at least building) the module first.
Installing modules isn't hard: most perl modules use the same sequence of commands for building / installing:
# perl Makefile.PL
# make
# make test
# make install
As long as the modules don't include C/XS code, all you need to install them is a standard make command.
Some newer modules use Module::Build instead. Theoretically, you'll only need perl to build those (again, unless you need to compile C/XS code, in which case you'd need a working C compiler).
Personally, I tend to just use either the CPANPLUS or CPAN module to install stuff. It generally is a lot less hassle than trying to subvert the installation process, unless you know what you're doing. In other words, since you're new to perl, please don't mess about with this, and install the modules like they expect to be installed. You'll save yourself a lot of trouble.
See also A Guide to Installing Modules.
| [reply] [d/l] [select] |
Thank you lots of good stuff and I agree, I will just install them the way they are meant to be. Thanks.
| [reply] |
You can use lib "/path/to/my/custom/modules"; and use the modules stored there. The path in this statement will be prepended to perl's search path. See perlmodlib.
You can also set the environment variable PERL5LIB to some path. Has the same effect (but this path will be second, if you do use lib
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
| [reply] [d/l] [select] |
Thank you both. I am obvisouly new, and someone pointed out I could just install the mods, I was hoping to avoid this and probably can, but installing the mods on the servers will work and its a simple build doc update here for said server.
learn something new every day lol -
perl Makefile.PL
make
make test
make install
I am really begining to see the importance of this site. :)
| [reply] |