#!/usr/bin/perl use WWW::Mechanize; my $alias = 'Linux Mozilla'; our $mech = WWW::Mechanize->new(agent => $alias); $mech->stack_depth(0); $mech->timeout(10); my $url = "http://www.nonexistent.com"; my $response = $mech->get($url); if ($response->is_success) { print 'OK'.$/; } else { print 'ERROR'.$/; }