Hi, Instead of simply using the get method of mechanize the way it is suggested, like this....
$m->get($link);
....where $link is a WWW::Mechanize::Link object, I found that occasionaly it would hang up if the URL was invalid and my program would stop working. Because of this, it was suggested that I change my code so that it now reads like this....
my $connected = eval { $m->get($link); 1 }; if (! $connected) { #do something else }
....and this seemed to do the trick. However, after getting a few hundred valid URLs, all of a sudden, even this way of constructing it failed to move on when a perfectly valid link was found as follows... http://www.aaaedm.com/contact.htm ....this particular link was found by a previous fetch using the get method. If you try to go to that URL in IE, nothing unusual happens, yet my $m->get just doesn't work at all, hanging up the program at that point, even though there's nothing at all wrong with that URL. Can anyone tell me why $m->get fails for this particular web address after previously working correctly on hundreds of other URLs? Since I have about 10,000 more to go through, I assume the same problem is going to happen again. Perhaps if I knew why it was happening, I could come up with some sort of solution. thanks!

In reply to WWW::Mechanize get doesn't work by zingbust

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.