use strict; use warnings; use LWP::UserAgent::ProxyAny; use HTTP::Request; print "Connecting...\n"; my $ua = LWP::UserAgent::ProxyAny->new; $ua->env_proxy; my $url="https://www.google.com"; my $req = HTTP::Request->new(GET => $url); my $response = $ua->request($req); if ($response->is_success) { print "OK CONNECTION!\n"; } else{ print "NO CONNECTION!\n"; }