rachard11 has asked for the wisdom of the Perl Monks concerning the following question:

Why does the following code result in the error message: "Error GETing Can't connect to (Bad hostname) at (reference to the last line in the code below)? Based on related posts, this problem should either be fixable by modifying the code below or by adjusting my connection (DNS) settings in my computer, but I've not been able to figure out the solution exactly. I'm using Windows 7, Chrome is my default browser, I can successfully ping from the command prompt.

#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize ; my $mech = WWW::Mechanize->new(); foreach my $line (100982..106146) { next if 0.99 > rand ; print "Now processing $line \n" ; my $get_file = " +ml?id=".$line; my $filename = "file_".$line ; open OUT, ">$filename" or die $!; print "file $filename \n"; $mech->get($get_file) ;