homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

Virtual pm directory

 8:08 am on Sep 12, 2011 (gmt 0)

I found at a couple places where it said you could create a folder for uploading modules to and to include the directory to the search list by adding use lib "/path/modules"; (path is a substitute word for the real path) and then to call them the same as other modules with
use Module;
or if it is inside a sub folder:
use Subfolder::Module;

I downloaded a module from cpan and ftp'd it into the folder but when I try to run the page it says it can't locate the file although I see from what the error says that the path was included in the search. Is there something that needs to be done? I've tried different permissions on the directoris, files, etc., but keep getting the same message. Thanks



 11:44 am on Sep 12, 2011 (gmt 0)

so you have a file named /path/modules/Module.pm or /path/modules/Subfolder/Module.pm?


 12:50 pm on Sep 12, 2011 (gmt 0)

no, "/path/modules/Module/Subfolder/Module.pm" was symbolic. In the script is a real and complete path the the file and Module.pm is actually Paginate.pm. Sorry about that one. I saw that at a couple places and it was stated that you could call a module in that fashion if on a server host and the module was not installed and the host will not install it. I get the error listing all the paths searched(one of which is the one in "use lib "/path/modules";")but it tells me the pm file can't be found.


 4:02 pm on Sep 12, 2011 (gmt 0)

did you try

push (@INC,'/path/to/install');



 8:58 pm on Sep 12, 2011 (gmt 0)

/path/modules/Paginate.pm exists?
(assuming you replace "/path/modules" with the "real and complete path")


 1:16 am on Sep 13, 2011 (gmt 0)

Got it now. The paths were all okay and module was installed. Everything came together with the line rocknbil provided. Funny thing though, after it located the modules, just to see what would happen I commented out the line push (@INC,'/path/to/install'); and it still worked. Is that something that needs to be done just to establish the new directory or should I keep that line there and also in other scripts or will it now find the modules automatically. Thanks, I took a class in cgi scripting--it was a real low budget class using cgi-lib.pl. It didn't really teach much. I've learned so much more at this site and just doing searches than the scripting class taught---although it did get me off the ground. phranque--the only reason I have been using the readform sub is because the pagination won't work without it, even using cgi.pm. I hope to overcome that using a pagination module though. Can't thank you enough.


 6:07 am on Sep 13, 2011 (gmt 0)

the "use lib" should have worked as well if it was coded properly.
i've "used" that method many times successfully.

and perl isn't going to have any memory of a previously coded, now commented line of code, so something else must have fixed your problem.

did you put the "use lib" before the "use Paginate"?


 8:52 am on Sep 14, 2011 (gmt 0)

Yeah, I think that was the problem--use Paginate was before use lib. I tried to put another module in and got this error:
Can't locate loadable object for module Crypt::Camellia
What does that mean? I looked everywhere and the only answers I could find were "did you install it properly"?. Unlike Paginate there is a whole lib of files in this one.


 11:18 pm on Sep 14, 2011 (gmt 0)

how did you install that module?


 12:42 am on Sep 15, 2011 (gmt 0)

I ftp'd it to the directory I made, same as I did for paginate.


 1:16 am on Sep 15, 2011 (gmt 0)

It was installed under Modules/Crypt

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved