Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which Module Is Used?

Status
Not open for further replies.

perlfan

Technical User
Apr 18, 2002
17
US
I'm using CGI.pm on my ISP's server but do not have write privaleges and need to make a few small changes. If I create a copy with the needed changes and put it in a directory, say /mydir/mymodules/, and then add "use lib '/mydir/mymodules/';" in my script will the script use my CGI.pm or the ISP's? I guess I could rename it removing all doubt but prefer not to do that. How can I dictate which CGI module is loaded? Perhaps the $ENV{'PATH'}; needs my directory prepended to it. Any ideas?
 
you can use 'require' instead, and then supply it with the fully quantified path to the module, and that should work. if you want it to behave the same as 'use', put the call to require in a BEGIN block. also note, it's not '$ENV{PATH}' that perl looks in for modules, it looks in '@INC'.

HTH "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top