library path @INC in a cgi-bin script

Posted on 2003-02-26
Medium Priority
Last Modified: 2010-03-05
i have got two versions of the same program, one run at command line and the other using cgi.  both of them use a library module i installed on the server under a non-standard path, say /home/me/lib.  the commandline version works fine after i set the env to include PERL5LIB.  

the problem is that the cgi version refuses to run complaining that it can't locate the module.

any idea?
Question by:crest
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 84

Expert Comment

ID: 8031360
use lib "/home/me/lib";

Author Comment

ID: 8032483
i tried use lib "/home/me/lib", but it didn't work.  appearently, the module that i used, uses other modules living in the same path, i.e. /home/me/lib

Accepted Solution

sykkn earned 400 total points
ID: 8044887
I have done it by changing the shebang (#!) before.  Looked like this:

#!/opt/perl/bin/perl -w -I/home/jowings/perl/lib/site_perl/5.6.1

Author Comment

ID: 8054209
cheers sykkn.

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
Six Sigma Control Plans
Suggested Courses

764 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