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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using modules in other directories 1

Status
Not open for further replies.

MatthewP

Programmer
Jan 16, 2001
176
GB
I am trying to get a script to use a module that is in a parallel directory to the script - ie. I'm in public_html/test, and the module is in public_html/modules.

I thought the 'use lib' command would work for this, like the following

use lib /home3/mysite/public_html/modules - but I get an illegal division by zero error when I try this!?!

I also tried all the obvious configurations eg. use ../modules/mymodule(mysub) but I can't get it to work - only for modules in the directory I'm in, or forward from where I an.

Surely this must be possible?

Thanks,
Matt.


 
Sure it's possible.
You must quote the path (with double quotes, for instance):

use lib "/home3/mysite/public_html/modules";

Or:

BEGIN { push @INC, "/home3/mysite/public_html/modules" }

...

cya

--
pkiller


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top