#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $URL = 'http://www.google.com'; my $UA = LWP::UserAgent->new(timeout => 10); my $response = $UA->get($URL); if ( $response->is_success ) { print $response->as_string; }else{ print "Couldn't open website: " . $response->status_line; }