#!/usr/bin/perl use LWP::UserAgent; use HTTP::Headers; my $theurl = "http://www.foo.com"; $h = new HTTP::Headers( Content_Type=>'text/html, text/plain, image/*', Accept=>'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.hp-hpf, */*', Accept_encoding=>"gzip, deflate", Accept_language=>"en-us", Connection=>"Keep-Alive", remote_addr=>'123.456', ); $ua = LWP::UserAgent->new; $request = HTTP::Request->new(GET => $theurl, $h); $ua->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90)"); $response = $ua->request($request); if ($response->is_success) { print "Content-Type: text/html\n\n"; print $response->content; } else { print "Error: " . $response->status_line . "\n"; } );