Welcome to WebmasterWorld Guest from 54.160.254.203

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Virtual pm directory

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

Junior Member from US 

5+ Year Member

joined:Feb 11, 2010
posts: 96
votes: 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 Sept 12, 2011 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10544
votes: 8


so you have a file named /path/modules/Module.pm or /path/modules/Subfolder/Module.pm?
12:50 pm on Sept 12, 2011 (gmt 0)

Junior Member from US 

5+ Year Member

joined:Feb 11, 2010
posts: 96
votes: 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 Sept 12, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


did you try

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

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

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10544
votes: 8


/path/modules/Paginate.pm exists?
(assuming you replace "/path/modules" with the "real and complete path")
1:16 am on Sept 13, 2011 (gmt 0)

Junior Member from US 

5+ Year Member

joined:Feb 11, 2010
posts: 96
votes: 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 Sept 13, 2011 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10544
votes: 8


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 Sept 14, 2011 (gmt 0)

Junior Member from US 

5+ Year Member

joined:Feb 11, 2010
posts: 96
votes: 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 Sept 14, 2011 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10544
votes: 8


how did you install that module?
12:42 am on Sept 15, 2011 (gmt 0)

Junior Member from US 

5+ Year Member

joined:Feb 11, 2010
posts: 96
votes: 0


I ftp'd it to the directory I made, same as I did for paginate.
1:16 am on Sept 15, 2011 (gmt 0)

Junior Member from US 

5+ Year Member

joined:Feb 11, 2010
posts: 96
votes: 0


It was installed under Modules/Crypt
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members