| 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'
|