Downloading a Web page in Perl using LWP::UserAgent

use strict;
use warnings;

use LWP::UserAgent;

main();

sub main {
    my $ua = LWP::UserAgent->new;
    my $request = HTTP::Request->new('GET', "http://www.martinbroadhurst.com");
    my $response = $ua->request($request);
    if ($response->is_success) {
        print $response->decoded_content;
    }
    else {
        die $response->status_line;
    }
}

Reference: LWP::UserAgent