Gossamer Forum
Home : General : Perl Programming :

LWP modules in local directories

Quote Reply
LWP modules in local directories
Hello, Im wondering what the call is so that a script will look in a particular directory for a perl module instead of whats available on the server.

Example, we have a script that requires LWP, while our server has it installed the techie guys can't get it working for us, so we have uploaded the modules that we need to our local directory and need to tell the script to find them there.

We did this a long time ago, but lost everything when someone hacked the server we're on and deleted everything off the server including the backups.

We thought it was just a simple
use lib "/my/directory/lib";
but that doesn't seem to work.
It's the lwp modules that we have uploaded to our server directory.

Anyone know what the call is to it?



------------------
Regards,
Visionary
Quote Reply
Re: LWP modules in local directories In reply to
I have the same problem since i'm testing on virtualave and i don't even think they have lwp, and i get it to find useragent in my folder, but then it looks in their folders for Debug.pm, So does anyone no how to make one of my folders be added into the INC?
Quote Reply
Re: LWP modules in local directories In reply to
I had similar problems on VirtualAve.net servers. I think they didn't install all modules that came with Perl 5. I had to manually install them in my home directory:

I have ActivePerl installed on my Win98 machine with all common modules.
http://www.activestate.com/
I uploaded these modules to /home/find/lib directory (my username was 'find' and domain 'http://find.virtualave.net').
Then, whenever I needed to use LWP or any other module, I would just call it within my scripts:
Code:
#!/usr/bin/perl
use lib '/home/find/lib';
use CGI;
use LWP::UserAgent;
use URI::Escape;
use HTTP::Request;
use HTTP::Response;
use Fcntl;
Everything was working fine, except for LWP module -- I never really got it working.

What I think is that VirtualAve is either operated by novice administrator or they are just too lazy to install these modules. I've written them few complains about this problem, but they still didn't install these modules.

Best regards,

Pasha

------------------
www.cellwarp.com
Quote Reply
Re: LWP modules in local directories In reply to
Pasha,

Virtualave told me in an email that they don't have the time to spend on CGI support because they're swamped just trying to maintain the network.

I replied and told them it's FOOLISH to offer cgi access and not even be able to support it. Does anyone know if hypermart allows LWP, IO::SOCKET::INET? They're both owned by the same company if you can imagine that. Seems like both servers would have the same service.

You can view your logs on Hypermat but not on Virtualave. You have SSL on Hypermart but not on Virtualave. I think I'm going to move to hypermart :-)

------------------
www.webgotcha.com
[b]admin@webgotcha.com[/b]
Quote Reply
Re: LWP modules in local directories In reply to
From what I know...
Hypermart.net was originally independant hosting company, then Go2net either got in partnership with Hypermar or bought it. The same thing happened to VirtualAve.net few months ago -- they started displaying Go2net ads on their site. I guess that VirtualAve is now a part of Go2net network.
Both Hypermart and VirtualAve have different configuration because they were started by different people/organizations.
I would choose Hypermart because it has lots of features like Error logs, all CGI modules installed, e-commerce, etc. And, I would choose VirtualAve because it doesn't require you to have a paid email account -- Hypermart will not accept your application it you got your email for free from HotMail.com, RocketMail.com, Chat.ru or any other free email services.

---
Quote Reply
Re: LWP modules in local directories In reply to
Well they don't have Parallel::UserAgent installed so I used the info you provided above to use the one that comes with Links.

use URI::URL; #using Hypermarts

#now using Links
use lib '/data1/hypermart.net/foo/admin';
use LWP::Parallel::UserAgent qw(:CALLBACK);

'use lib' adds a directory to the @INC array of places to look for modules.

*LOTS* of modules are available at http://cpan.perl.org/ , don't know how may can be used as is (no telenet/Makefile).

Denver, Hypermart does allow sockets and
I don't know what I would do without their error logs
Quote Reply
Re: LWP modules in local directories In reply to
You could always try this:

push @INC, "your/lib/directory";
use yourLib;

-- Gordon --


------------------
$blah='82:84:70:77';
print chr($_) foreach (split/:/,$blah);
Quote Reply
Re: LWP modules in local directories In reply to
I think I tried that and unshift @INC, '/my/dir'; ... the difference is that "lib module checks for machine-dependent subdirectories", not sure what that means but lib worked and is what's in the FAQ.

I tried installing a module using:

perl Makefile.PL PREFIX=/my/perl_lib
make
make test
make install

Ok up to make install where there seems no way to install to /my/perl_lib and the new/duplicate files and dir structure leave me lost and wondering what the point of PREFIX was.
Quote Reply
Re: LWP modules in local directories In reply to
What was the error returned when you tried to run the make install? (Did the make test give any errors?)

-- Gordon --

------------------
$blah='82:84:70:77';
print chr($_) foreach (split/:/,$blah);
Quote Reply
Re: LWP modules in local directories In reply to
No make test errors. I should have copied the install errors but the gist is that it was still trying to install in the Perl directories instead of my perl_lib dir. I'm pretty sure I used a full path to perl_lib in PREFIX and perl_lib is chmoded 777.

I would try moving the directories/files but I have no clue which are keepers/important.

My understanding is that my perl_lib should have subdirectories like HTML, LWP, etc. yet these directories are not root in the modules, rather confusing.

It'll probably have to wait till Sun. but I'll try it with another module.
Quote Reply
Re: LWP modules in local directories In reply to
...scratch that.

Most docs say to use PREFIX but I found mentions of LIB. I get an install warning but modules do install using LIB. A couple of scripts that wouldn't run before do now. Smile

[This message has been edited by Dave (edited October 29, 1999).]