in reply to http get with perl, help needed

My two favourite methods are LWP::Simple and `wget`. For instance:
use LWP::Simple; my $document = get("http://www.perlmonks.org");
or
my $document = `wget -qO- http://www.perlmonks.org`;
Most of the time I use LWP::Simple, but sometimes I try to download something from a site for which LWP::Simple doesn't fetch the page. It's usually much easier to use `wget` than to debug why I'm not able to fetch the page with LWP.

If I need something more complex than a few simple downloads, I use WWW::Mechanize or LWP.

Replies are listed 'Best First'.
Re^2: http get with perl, help needed
by Anonymous Monk on Oct 17, 2008 at 13:51 UTC
    How would you supply creds(auth) with this?
      I'd use either LWP::UserAgent, and define a get_basic_credentials method; use LWP::Simple and call $ua->credentials(); read the manual page of wget and detect it has --http-user and --http-passwd options, and it also willing to read a username/password from configuration files; or use WWW::Mechanize and call credentials().
        Thank you very much for your reponses. Im using a ua, but im going against windows auth. Still looking around on how to make this work.
        $ua->credentials("http://test.com:80", "test", 'user', 'pass');