#need to check LWP installation use LWP; print "This is libwww-perl-$LWP::VERSION\n"; #create object $browser my $browser = LWP::UserAgent->new; my $url = 'http://yahoo.com'; #create object $response my $response = $browser->get($url); #get method die "Can't get $url --- ", $response->status_line unless $response->is_success; print "Status = ". $response->status_line."\n"; die "Hey, I was expecting HTML, not ", $response->content_type unless $response->content_type eq 'text/html'; print "Content Type = ".$response->content_type."\n"; if($response->decoded_content =~ m/yahoo/i) { print "There is text 'yahoo'!\n"; } else { print "No text 'yahoo' found.\n"; } WaitForKey(); sub WaitForKey() { print "\nPress any key to continue..."; chomp($key = ); }