Forcing Specific Version of a module to be used from different location.

Question Title: Forcing module version to be used
Author: sstouk
Points: 125
Date: 11/04/2003 12:49PM EST
 


The OS has a module with an older version.
Entity.pm which is version 3.09 (HTML::Entity)
I downloaded Entity.pm version 3.16
The application I develop needs a version above 3.15, so the one I've got is OK
It is a web server where I do not have admin rights to put the updated Entity.pm into the Perl path and substitute the old one.
All the modules I need I usually install under the cgi-bin/ web folder and it works just fine, recognizing modules that are not present on the web server.
I need a way to tell my application to use Entity.pm not from the Perl default location, but from the cgi-bin/HTML/Entity.pm location.
So that the command:
use HTML::Entity
would get the file from cgi-bin/HTML/Entity and not from c:\Perl\lib\..... etc

Any ideas?
 
 
LVL 6
sstoukAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arjanhCommented:
You can let perl first look in your cgi-bin directory, and only thereafter in the system dirs like this:

unshift (@INC, "cgi-bin/"); # Prepend a directory name
use HTML::Entity;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
inq123Commented:
for you, this would work (it's the same mechanism as the post by arjanh but that post probably won't work for you because the directory is not right):

use lib '.'; # cgi-bin won't work in your case I think
use HTML::Entity;
0
sstoukAuthor Commented:
Does this just adds or reverses the order of search or completely substitutes it?
I do not want to substitute, just to reverse.
I think that unshift (@INC, "cgi-bin/"); # Prepend a directory name
Is adding the initial path to search for, what about
use lib '.'; # cgi-bin won't work in your case I think
?
BTW
unshift (@INC, "."); # Prepend a directory name
Works perfectly so as the:
use lib '.'; # cgi-bin won't work in your case I think
Basically both of you answered the question correctly and without comment of inq123 suggestion posted by arjanh would really not work for me, I tried.
But I got an idea anyway.

I would like to split the points if possible I will see if I can try, if not, I have to assign point to whomever answered first.

thanks alot.

 


0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

sstoukAuthor Commented:
There was no option to split the points. Sorry inq123.
0
sstoukAuthor Commented:
Too bad I learned how to split points just now :(
0
inq123Commented:
In fact, if no option to split, then you should accept my comment because mine worked for you.  Grading guide suggests that you accept the first working solution.  As I pointed out already, although my solution is the same mechanism as previous one, mine should work for you but his won't.

But well, it's OK.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.