Using uninstalled Modules
Hi there,
This is a question I have for some time, but I can't find the answer. How do we use a Module ( or a package with several ones ) written in Perl, but without installing it in the library of the server ( the hosts, generally, don't install them... )? With small ones, they just function right - but with others no. Does anyone knows a solution to this? Kind regards, Rigel_Kent |
You can't use a module without making the code accessible to Perl in some way. So this all depends on what you mean by “install”.
If your Perl module has a modulename.pm file, then you can include it with: Code:
use modulename; So all you need to do to install a module is add the path to the module to @INC: Code:
BEGIN { If your module name contains :: then the .pm file lives in a sub-directory; you need to put the parent of the sub-directory into @INC. (e.g. if your module is named Test::Module and is in /home/testuser/perl/test/module.pm then you would want to add "/home/testuser/perl/" to @INC). You can also modify the search path on the command-line rather than in a BEGIN block: Code:
perl -I'/path/to/module/' … |
Yep...
Hi,
Thanks for the reply. I'll try it - and I believe it will work. I'll let you know. Thanks again, Rigel_Kent |
All times are GMT -5. The time now is 04:38 PM. |