BEGIN{ $ENV{HTTPS_PROXY} = 'http://myproxyserver:port'; $ENV{HTTP_PROXY} = 'http://myproxyserver:port'; } use WWW::Mechanize::PhantomJS; use Data::Dumper; my $mech = WWW::Mechanize::PhantomJS->new(); $mech->get('http://google.com'); print Dumper $mech->content();