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-perl-5.800/lib/LWP.pm>


-- Chris Devers [EMAIL PROTECTED] http://devers.homeip.net:8080/blog/

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

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to