title: Perl: Grabbing the nth and mth delimited words from each line in a file
body: <p>Because of the more tedious way of adding hosts to be monitored in Nagios (it requires defining a host object, as opposed to the previous program which only required the IP and hostname), I figured it'd be best to automate this, and it'd be a great time to learn Perl, because all I know at the moment is C/C++ and Java.  </p>
  
  <p>The file I read from looks like this:</p>
  
  <pre><code>xxx.xxx.xxx.xxx hostname #comments. i.dont. care. about
  </code></pre>
  
  <p>All I want are the first 2 bunches of characters.  These are obviously space delimited, but for the sake of generality, it might as well be anything. To make it more general, why not the first and third, or fourth and tenth?  Surely there must be some regex action involved, but I'll leave that tag off for the moment, just in case.</p>