OK, further investigation suggests that it's not one bad link, but that the server just sometimes returns a 500 error. Other times it succeeds. If I run my script several times, it will sometimes succeed and sometimes fail -- and I get the same results if I try to follow the link several times in my browser.
I was able to get around it like this:
my $maxtries = 10;
my $i = 1;
while ($i <= $maxtries) {
$mech->follow_link(text => "Hey Jude (lennon/mccartney)", n => "1"
+);
last if $mech->success;
$mech->back();
$i++;
}
$mech->success() or die "Can't find song page\n";
Of course, you can set $maxtries to whatever you think is prudent, and you can put in a sleep() in the loop if you think that might help.
Linda