#!C:/Perl/bin -w use LWP::UserAgent; use HTML::Parser; use strict; use HTTP::Request::Common; my %form = "country_form_0"; my $i = 0; my $agent = LWP::UserAgent->new; $agent->timeout(60); my @fields = ("country", "years1%5B%5D","c_tab","idbtable"); my $url = "http://www.census.gov/ipc/www/idb/country.php"; my @countries=("GI","GR","GL","GJ","GQ","GT","GK","GV","PU","GY","HA","HO","HK","HU","IC"); my @years =("2000","2001","2002","2003","2004","2005","2006","2007","2008","2009","2010"); my @tabs =("0","1","2"); for(1..4){ my $response = $agent-> post($url, $forms [ "country" => $countries[$i], "years1%5B%5D" => $years[0], "c_tab" => '0', "idbtable" => '0' ]); my $cont = $agent->request($response); print "$cont"; $i++; }