My workplace uses XP and I was trying to run the following script on it
use strict;
use warnings;
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
$mech->get( 'http://google.com' );
$mech->submit_form(
form_number => 0,
fields => {
q => 'led zeppelin',
}
);
print $mech->content;
However, when I try to run the script through DOS, I always get an error message saying that the page cannot be loaded because my computer can’t connect to google.com:80 because of a timeout.
As far as I know, this is not an internet problem, because my browser seems to be running fine. What I want to know is, are there any other permissions or parameters to be set so the site can be loaded? If not, what is the problem?
Maybe the Internet can only be accessed through a proxy server in your workplace, which is a common practice.
See How do I use WWW::Mechanize through a proxy server? in
WWW::Mechanize::FAQ.