#!/usr/local/bin/perl


#perl2exe_exclude "IO/HTML.pm"
#perl2exe_exclude "Encode/Locale.pm"
#perl2exe_exclude "LWP/MediaTypes.pm"
#perl2exe_exclude "HTTP/Cookies.pm"
#perl2exe_exclude "Encode/Locale.pm"

#perl2exe_exclude "Win32/API.pm"
#perl2exe_exclude "Win32/Console.pm"
#perl2exe_exclude "Compress/Bzip2.pm"
#perl2exe_exclude "File/BSDGlob.pm"

#perl2exe_include "HTTP/Message.pm"
#perl2exe_include "URI/_query.pm"
#perl2exe_include "unicore/lib/Perl/_PerlIDS.pl"
#perl2exe_include "URI/_server.pm"

#perl2exe_include "overloading.pm"
#perl2exe_include "unicore/Heavy.pl"

BEGIN {$ENV{ACTIVEPERL_CONFIG_DISABLE} = 1;}





use LWP::UserAgent;



my $URL = $ARGV[0] || '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;

}





