sub check_uri_status { my $self = shift; my $uri = $self->query->param('uri') or die("Missing URI."); # create the user agent we want to use to check the websites my $ua = LWP::UserAgent->new(); $ua->default_header(ACCEPT_LANGUAGE => 'en'); $ua->max_redirect(24); my $req = HTTP::Request->new(GET => $uri); $req->header('Accept' => 'text/html'); # send request my $res = $ua->request($req); my $result = $res->status_line(); return $result; } # /check_uri_status