title: How do I download a file using Perl?
body: <p>I'm running Perl on Windows XP, and I need to download a file from the URL <a href="http://marinetraffic2.aegean.gr/ais/getkml.aspx" rel="noreferrer">http://marinetraffic2.aegean.gr/ais/getkml.aspx</a>.</p>
  
  <p>How should I do this? I have attempted using WWW::Mechanize, but I can't get my head around it.</p>
  
  <p>This is the code I used:</p>
  
  <pre><code>my $url = 'marinetraffic2.aegean.gr/ais/getkml.aspx';
  my $mech = WWW::Mechanize-&gt;new;
  $mech-&gt;get($url);
  </code></pre>