Dear Monks,
I am trying to run following simple code from my machine
use strict; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->get("http://www.google.com"); print $mech->content();
I am getting following error page in return (Surprisingly when I go to www.google.com through Mozilla or IE it allows me to go to it.) Any idea what has gone wrong?

The error is follows.
=======================
<H1>ERROR</H1> <H2>Cache Access Denied</H2> <HR noshade size="1px"> <P> While trying to retrieve the URL: <A HREF="http://www.google.com">http://www.google.com</A> <P> The following error was encountered: <UL> <LI> <STRONG> Cache Access Denied. </STRONG> </UL> </P> <P>Sorry, you are not currently allowed to request: <PRE> http://www.google.com</PRE> from this cache until you have authenticated yourself. </P> <P> You need to use Netscape version 2.0 or greater, or Microsoft Internet Explorer 3.0, or an HTTP/1.1 compliant browser for this to work. Plea +se contact the <A HREF="mailto:root">cache administrator</a> if you have difficulties authenticating yourself or <A HREF="http://squid.YOURDOMAINHERE.com/cgi-bin/chpasswd.cgi">change< +/a> your default password. </P> <BR clear="all"> <HR noshade size="1px">

20060505 Janitored by Corion: Moved error message HTML into code tags


In reply to Mechanize module by sanPerl

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.