http://www.perlmonks.org?node_id=605659


in reply to WWW::Mechanize - Could not connect to a server

You've mentioned you're using a proxy.

You need to set up WWW:Mechanize to use your proxy. Ideally, you'll use the in-built OS options, but as a shortcut (to check if this actually is your problem) then just use:

my $mech = WWW::Mechanize -> new(); $mech -> http_proxy ( "Your_proxy_address:proxy_port" )
I've also found enabling LWP debugging to be most useful when troubleshooting Mechanized scripts.
use LWP::Debug qw(+);