#!/usr/bin/perl -w use strict; use LWP::UserAgent; use HTTP::Response; use constant URL => 'http://google.com/search?q='; use constant DICT => '/usr/share/dict/words'; use constant UA => 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; T312461)'; my $w = ''; open HAL, DICT or die "Error opening ", DICT, " for reading: $!\n"; rand($.) < 1 && ($w = $_) while ; close HAL; my $agent = LWP::UserAgent->new(env_proxy => 0, keep_alive => 0, timeout => 60); $agent->agent(UA); my $resp = $agent->get(URL . $w); print $resp->is_success ? $resp->content : $resp->error_as_HTML;