title: How to multithread seeing if a webpage exists in Perl?
body: <p>I'm writing a Perl script that takes in a list of URLs and checks to see if they exist. (Note that I only care if they exist; I <em>don’t</em> care what their contents are. Here’s the important part of the program.</p>
  
  <pre><code>use LWP::Simple qw($ua head);
  
  if (head($url))
  {
      $numberAlive ++;
  }
  else
  {
      $numberDead ++;
  }
  </code></pre>
  
  <p>Right now the program works fine; however, I want it to run faster. Thus I'm considering making it multithreaded.  I assume that the slow part of my program is contacting the server for each URL; therefore, I'm looking for a way in which I can send out requests to the URLs of other webpages on my list while I'm waiting for the first response.  How can I do this?  As far as I can tell, the <code>head</code> routine doesn't have a callback that can get called once the server has responded.</p>