#!/usr/local/bin/perl

BEGIN {$ENV{ACTIVEPERL_CONFIG_DISABLE} = 1;}

use LWP::UserAgent;

my $URL = $ARGV[0] || 'http://www.example.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;
}

