use LWP; use URI; my $browser = LWP::UserAgent->new; #demo #check html code of www.imbd.com and search gladiator #this is the URL at the form action field my $url = URI->new ('http://www.wikipedia.org/search-redirect.php'); #makes an object representing the URL #may not work for sites which generate temporary files $url -> query_form ( 'search' => 'Gladiator', 'language' => 'en' ); my $response = $browser->get($url); $outputfile = ">temp.htm"; if (open(MyOutputFile, $outputfile)) { print "OutputFile '",$outputfile,"' opened OK \n"; } else { print "Cannot open OutputFile '",$outputfile,"'\n"; exit; } print MyOutputFile $response->decoded_content; WaitForKey(); sub WaitForKey() { print "\nPress any key to continue..."; chomp($key = ); }