Solved

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

Posted on 2003-11-04
6
182 Views
Last Modified: 2010-03-04
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?
 
 
0
Comment
Question by:sstouk
  • 3
  • 2
6 Comments
 
LVL 5

Accepted Solution

by:
arjanh earned 125 total points
ID: 9680562
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
 
LVL 8

Expert Comment

by:inq123
ID: 9681382
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
 
LVL 6

Author Comment

by:sstouk
ID: 9681487
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Author Comment

by:sstouk
ID: 9681502
There was no option to split the points. Sorry inq123.
0
 
LVL 6

Author Comment

by:sstouk
ID: 9681550
Too bad I learned how to split points just now :(
0
 
LVL 8

Expert Comment

by:inq123
ID: 9681605
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Port 80 requests 16 87
Move Function in Perl Script 2 65
Vb script to unzip a files and rename the files 12 96
Control Number of Log Files -Perl 7 54
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now