Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-13-2005, 01:25 PM   #1
Registered: Nov 2004
Posts: 64

Rep: Reputation: 15
Question 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,

Old 06-14-2005, 11:53 AM   #2
Senior Member
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,991

Rep: Reputation: 76
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 file, then you can include it with:
use modulename;
This will search for on every directory listed in @INC, in turn.

So all you need to do to install a module is add the path to the module to @INC:
 unshift @INC, "/path/to/module/";
use modulename;
You need to put the code to modify @INC in a BEGIN block in order for it to be changed before the use statement.

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/ 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:
perl -I'/path/to/module/' …
Old 06-14-2005, 12:26 PM   #3
Registered: Nov 2004
Posts: 64

Original Poster
Rep: Reputation: 15


Thanks for the reply. I'll try it - and I believe it will work. I'll let you know.

Thanks again,



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
uninstalled Mandrake10 Haggis56 Linux - Newbie 2 01-12-2005 07:30 PM
Can UP2DATE be uninstalled? How exactly??? jdruin Linux - Software 5 10-22-2003 06:29 PM
RPM, installed but uninstalled??? Daem0hn Linux - General 8 07-19-2003 03:50 AM
Re: modprobe: Note: /etc/modules.conf is more recent than lib/modules/2.4.9/modules.d Andy.M Linux - General 1 01-24-2002 01:50 AM
Re: modprobe: Note: /etc/modules.conf is more recent than lib/modules/2.4.9/modules.d Andy.M Linux - Newbie 2 01-24-2002 01:40 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:21 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration