For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > September 2004 > Re: How to get config file via http









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: How to get config file via http
Chris Devers

2004-09-02, 8:56 pm

On Tue, 31 Aug 2004, Tim Musson wrote:

> CD> use LWP::Simple;
> CD> $content = get($URL);
>
> CD> Or to be more robust about it:
>
> CD> use LWP::Simple;
> CD> unless (defined ($content = get $URL)) {
> CD> die "could not get $URL\n";
> CD> }
>
> CD> Make sense?
>
> Yep, I also noticed Net::HTTP. Any reason I should use one over the
> other?


The LWP bundle is the primary toolkit for client side web programming
with Perl. Unless you're doing something more involved -- like the
things that can be done with WWW::Mechanize and HTTP::Recorder -- the
LWP toolkit is probably the place to start for this kind of work.

I mean really, how much simpler can it be than "get($url)" ? :-)

But read the perldoc for LWP (and the modules it bundles) to get a
fuller idea of what you can do:

<http://search.cpan.org/~gaas/libwww....800/lib/LWP.pm>


--
Chris Devers cdevers@pobox.com
http://devers.homeip.net:8080/blog/

np: 'Mahna Mahna!'
by The Muppets
from 'The Muppet Show'
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com