CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
LWP modules

 



uatt
User

Sep 12, 2002, 6:34 AM

Post #1 of 13 (1660 views)
LWP modules Can't Post

My web server(Linux) don't provide LWP modules and the host manager refuse to install the module for his custome..

I decide to place the module in my own folder and use lib to gain access the LWP

But there are so many versions there..my question is

1. My plan workable?

2. which modules of LWP.pm should I use?

3.It may make use of other modules and its sub method.. so any other LWP:: should I download?

Thanks........


Paul
Enthusiast

Sep 12, 2002, 10:32 AM

Post #2 of 13 (1646 views)
Re: [uatt] LWP modules [In reply to] Can't Post

No-one call tell you what module to use unless you tell us what your script is doing.


uatt
User

Sep 13, 2002, 5:59 AM

Post #3 of 13 (1637 views)
Re: [RedRum] LWP modules [In reply to] Can't Post

What I am going to try is just to grab a url page lide following...

Code
  use LWP::Simple;unless (defined ($content = get $URL)) {     die "could not get $URL\n";}



Seemingly I have to download all bundles libwww as the pakage Simple.pm

has to use many other pakages inside the libwww::HTTP:: and others,

so how to do all that

(This post was edited by uatt on Sep 13, 2002, 6:01 AM)


davorg
Thaumaturge / Moderator

Sep 13, 2002, 2:51 PM

Post #4 of 13 (1631 views)
Re: [uatt] LWP modules [In reply to] Can't Post

If your web host won't install extra modules from CPAN for you, then I'd seriously consider getting a better web host.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


Fred123
Novice

Nov 26, 2002, 8:04 AM

Post #5 of 13 (1590 views)
Re: [uatt] LWP modules [In reply to] Can't Post

Here:

1. Download the latest version of the package at CPAN.ORG:
(Currently 5.65, the link below is directly to the file)

http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/libwww-perl-5.65.tar.gz

2. Upload the file in BINARY format into your CGI-BIN.

3. Through telnet* run the commands below (one at a time):

gunzip libwww-perl-5.65.tar.gz

tar -xf libwww-perl-5.65.tar

perl Makefile.PL

make

make test

make install

Usually you simply just use the following in your scripts: LWP::Simple
But now you have to use the following to tell Perl where the library is installed:

use lib '/var/www/cgi-bin/libwww-perl-5.65/lib'; (YOUR PATH!)
use LWP::Simple;


Here's a test file, just copy and use as a CGI:
#!/usr/bin/perl
use lib '/var/www/cgi-bin/libwww-perl-5.65/lib';
use LWP::Simple;
$content = get ('http://www.schoolbag.com');
print "Content-type: text/html\n\n";
print "$content";



*= If you dont have Telnet access you can use Fileman.cgi from Gossamer Threads, it's a free admin program and very easy to set-up and use:
http://www.gossamer-threads.com/scripts/fileman/index.htm


kojr
Novice

Nov 26, 2002, 11:40 PM

Post #6 of 13 (1582 views)
Re: [Fred123] LWP modules [In reply to] Can't Post

Thank you fred123...

You have thought all the things for me...

I'll try it out and see if it is successful..


davorg
Thaumaturge / Moderator

Nov 27, 2002, 2:21 AM

Post #7 of 13 (1579 views)
Re: [Fred123] LWP modules [In reply to] Can't Post

That is almost certain to fail as LWP has a large number of dependencies on other modules which may well not be installed.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


uatt
User

Nov 27, 2002, 4:53 AM

Post #8 of 13 (1576 views)
Re: [davorg] LWP modules [In reply to] Can't Post

you are right...

I decide to quit..

thanks every knd heart person..


Fred123
Novice

Nov 27, 2002, 8:06 AM

Post #9 of 13 (1569 views)
Re: [davorg] LWP modules [In reply to] Can't Post

"That is almost certain to fail"



It worked for me and many other folks at my host. It's better than telling people to find another host.


Paul
Enthusiast

Nov 27, 2002, 10:31 AM

Post #10 of 13 (1563 views)
Re: [Fred123] LWP modules [In reply to] Can't Post

You can't use make install without being root so unless you were root then it would fail.


James
Troll

Nov 27, 2002, 10:40 AM

Post #11 of 13 (1563 views)
Re: [davorg] LWP modules [In reply to] Can't Post


In Reply To
If your web host won't install extra modules from CPAN for you, then I'd seriously consider getting a better web host.



It would be an irresponsible web host that would install any possible module or application that might be requested by a customer. A "better web host" would carefully evaluate the request and make an informed decision -- in light of their particular system configuration and constraints -- as to whether or not to install it. Some modules can and should be installed; but there may be perfectly valid reasons why a host would choose not to install every possible module that a customer might want.

The decision regarding which modules to install ought to be made with the same degree of caution that you would apply to selecting programs and scripts to download and install on your web site or your computer.

On the other hand, LWP is a pretty standard module, as are several others. Those modules probably ought to be installed already by any host that claims to support Perl. A host that doesn't support LWP is probably not a good choice for someone who wants to run a lot of Perl scripts, but they may be perfectly fine for other purposes.

James
www.yourdomainhost.com
Yes, LWP is installed on our servers.


Paul
Enthusiast

Nov 27, 2002, 1:51 PM

Post #12 of 13 (1557 views)
Re: [James] LWP modules [In reply to] Can't Post

I made a script using LWP to auto-submit to Gossamer-Forum I wonder if I should try it out here Wink

It can make about 20 new threads in a few seconds.

I used it as a bot to reply to people who made posts with CAPS LOCK ON or those swearing.

Sorry to be off-topic.


davorg
Thaumaturge / Moderator

Nov 27, 2002, 2:21 PM

Post #13 of 13 (1554 views)
Re: [RedRum] LWP modules [In reply to] Can't Post


In Reply To
You can't use make install without being root so unless you were root then it would fail.


You don't have to be root to run "make install" as long as you set the PREFIX correctly when you ran "perl Makefile.PL PREFIX=/somewhere/you/can/write/to".

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives