I have updated my code to look like this. When i run it though it says it cannot find the specified link. Also what is a good way to test that it is indeed connecting to the page?
#!/usr/bin/perl -w
use strict;
use LWP;
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
my $browser = LWP::UserAgent->new;
$browser->credentials(
'Apache/2.2.3 (CentOS):80',
'datawww2.wxc.com',
'************' => '*************'
);
my $response = $browser->get(
'http://datawww2.wxc.com/kml/echo/MESH_Max_180min/'
);
$mech->follow_link( n => 8);
(Original Post) What is the best way to download small files with perl. I looked on CPAN and found lwp-download but it seems to only download from the link. I have a page with links that change every thirty minutes with the date and time in the name so they are never the same. Is there a built in function I can use? Everyone on google keeps saying to use wget, but I was kind of wanting to stick with perl if possible just to help me learn it better while I program with it. Also there is a user name and password to log into the site. I know how to access the site using perl still, but I thought that might change what I can use to download with.