title: Perl WWW::Mechanize -- Authentication Error GETing URL
body: <p>I'm trying to fill out a web form using the Mechanize library of Perl.</p>
  
  <p>Whenever I enter the URL into the search box it prompts the below message, and I can manually login sucessfully.</p>
  
  <p><img src="https://i.stack.imgur.com/RV17h.jpg" alt="enter image description here"></p>
  
  <p>However, when I run the below script, I get the following error:</p>
  
  <p><img src="https://i.stack.imgur.com/W2IsW.jpg" alt="enter image description here"></p>
  
  <p>How do I correctly fill in the first Authentication Box credentials using my <code>$mech</code> object?</p>
  
  <pre><code>my $mech = WWW::Mechanize-&gt;new( 'keepalive' =&gt; 1 );
  
  my $url = "http://URL/I/NEED/TO/ACCESS";
  my $username = "username";
  my $password = "password";
  
  $mech-&gt;credentials($username, $password);
  $mech-&gt;get($url);          &lt;----------------- ERROR (LINE 93)
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Here are the results of running <code>wget</code> on the requested site</p>
  
  <pre><code>--2013-08-30 11:16:17--  http://moss.micron.com/MFG/ProbeTest/Lists/Manufacturing%20Requests/AllItems.aspx
  Resolving moss.micron.com... 137.201.88.118
  Connecting to moss.micron.com|137.201.88.118|:80... connected.
  HTTP request sent, awaiting response... 
    HTTP/1.1 401 Unauthorized
    Server: Microsoft-IIS/7.0
    WWW-Authenticate: Negotiate
    WWW-Authenticate: NTLM
    X-Powered-By: ASP.NET
    MicrosoftSharePointTeamServices: 12.0.0.6341
    Date: Fri, 30 Aug 2013 17:16:17 GMT
    Connection: keep-alive
    Content-Length: 0
  Authorization failed.
  </code></pre>