Hmm ... I've never used WWW::Mechanize so I can't really comment directly on the exact problem, though I can offer a few suggestions. 1: My guess is that $mech->quiet(1); is going to suppress any errors that might get returned, while your debugging it would probably be a good idea to set it to 0 or comment out the line (assuming WWW::Mechanize returns errors by default) so you can see if you get an error. Secondly I know that your site is an example but if the page you're trying to get is an ASP page, be sure that there isn't some kind of IE specific things on it that would cause it not to return correctly for your agent. And finally I would make sure that $mech->content() returns a SCALAR value.

Hope that helps

Lobster Aliens Are attacking the world!

In reply to Re: My Mechanize script cannot work ? by cfreak
in thread My Mechanize script cannot work ? by donno20

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.