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

How to know that LWP::Simple have been installed

Status
Not open for further replies.

rubis

Programmer
Jun 21, 2001
54
GB
Hi all,

At the first place, I used the following code to check if LWP::Simple has been installed

eval "use LWP::Simple";
if ($@) {
print "LWP installed\n";
} else {
print "LWP not installed\n";
}

Once I runned this code, it said "LWP installed"

Then I runned another code

use LWP::Simple;

$url = 'getstore($url, "g.html");

if (-e "g.html") {
$size = (stat('g.html'))[7];
print "size - $size\n";
unlink './g.html';
} else {
print "g.html - not exist";
}

There was an error said
"Can't locate LWP/Simple.pm in @INC (@INC contains:/usr/lib/perl5/5.005/i386-linux /usr/lib/perl5/5.005 /usr/local/lib/site_perl/i386-linux /usr/local/lib/site_perl /usr/lib/perl5) at x.pl line 3
BEGIN failed--compilation aborted at x.pl line3"

I don't know what's wrong. Any suggestion?? Thanks.
 
A few things to try:

1) do 'perldoc -l LWP::Simple' at a command prompt -
(that's a minus small L) that should tell you where
LWP::Simple exists

2) on Linux, I can do 'locate Simple.pm' and the locate
command tells you where on your filesystem(s) it
finds the file you are looking for.

Do 'perl -V' to find out what your @INC array contains.
Compare that to where you find LWP/Simple.pm

HTH.
Hardy Merrill
Mission Critical Linux, Inc.
 
I can't figure out how to do this. How annoying.... :-( Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top