Forum Moderators: coopster & phranque

Message Too Old, No Replies

How to tell Perl to forget its @INC path

custom @INC path module

         

Mahendra

8:53 pm on Dec 7, 2003 (gmt 0)



Hello everyone,

The title may seem very misleading, but my problem is as follows:

I have to develop a project as part of my college curriculum.

The project has to be done in Perl. I am doing it already.

I am doing it in my house on Windows XP using Activestate Perl 5.8.0

My real problem is this, in my college I have to run my program in Linux, so as you know I would need to install the required modules, but in my college there is no internet.

So what I plan to do is download modules that I need, like CGI.pm, mysqlPP.pm and so on from the internet and carry it on to college.

In my program I will use these statements and put all the *.pm files in there.

use lib "/home/mahendra/modules";

Will it work?

I have serious concerns that the modules that exists already in there will conflict with this or something like that.

(I am doing this because, I am sure not all the modules I use are there in the college)

In otherwords can we tell Perl to forget the @INC path it has and use only the one's I provide?

Thanks for reading this long post.

alexhudson

9:12 pm on Dec 7, 2003 (gmt 0)

10+ Year Member



You can have multiple versions of the same module in @INC and there will be no conflict - the first one Perl finds, it will use. Your 'use lib' stuff is the way to go.

However, if you're using many modules you might find some of them rely on XS - that is, you're not just going to be able to zip them up and take them around with you.

You might want to investigate the PAR system for building .par files that contain your dependencies, this is the standard way of doing things.