#!/usr/local/bin/perl

use LWP::UserAgent;

my $URL = 'http://www.cnn.com';
print "Fetching $URL ...\n";


$ua = new LWP::UserAgent;
$req = new HTTP::Request 'GET' => "$URL";
$res = $ua->request($req);
if ($res->is_success) {
  #print ($res->content);
  printf "fetched %d bytes\n", length($res->content);
} else {
  print "Error: " . $res->code . " " . $res->message;
}


