It could be that the server in question started checking for the user agent type of all incoming requests, and rejecting those corresponding to the $ua object of LWP::Simple. To test this hypothesis, add the following line somewhere after the definition of my $ua, but before calling LWP::Simple::get:
The idea is to make the agent field LWP::Simple's internal user agent object (which is also called $ua) match the corresponding default agent field for a LWP::UserAgent object (like your $ua).
Update: I should have pointed out in my original post that if the hypothesis above is correct, this would strongly suggests that the site you are trying to access has an anti-robot policy. The workaround implied by the code above is a technical solution, but it is up to you to determine what the site's robot policy is (starting with reading their robots.txt file, if any), and weigh the consequences of circunventing it. Some site's are very strict and unequivocal about this.
Update 2: As indicated by the overstrike above, the particular details of what I proposed were wrong, because importing $ua from LWP::Simple has side-effects that don't take place if one omits the import step and uses the fully qualified $LWP::Simple::us, which I was not aware of (thanks++ to dpmott for pointing it out).
the lowliest monk
In reply to Re: Why would LWP::Simple::get stop working?
by tlm
in thread Why would LWP::Simple::get stop working?
by dpmott
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |