title: HTML parsing in perl
body: <p>I'm trying to parse the following HTML structure with in perl. I need to select all of the dd elements that contain the class message and also an id. 
  All I would like the script to do is loop through all of the dd elements and print out the id of the dd element but it needs to ignore the first dd element as that is static and will not change.</p>
  
  <p>It can be with any perl module as long as it can be installed from cpan to make it easy for me. I don't have much experience with perl and parsing html so any pointers would be very helpful.</p>
  
  <p>Thanks :)</p>
  
  <p>HTML Structure:</p>
  
  <pre><code>&lt;pre&gt;&lt;code&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
   .....other elements
      &lt;div id="messages"&gt;
          &lt;div class="header"&gt;&lt;/div&gt;
          &lt;dl&gt;
              &lt;dd class="message unread mc-friend mc-message"&gt;This is just a random message, do not parse&lt;/dd&gt;
              &lt;dd id="msg2" class="message unread mc-message"&gt;
                  Hello
              &lt;/div&gt;
              &lt;dd id="msg3" class="message unread mc-message"&gt;
                  Hello
              &lt;/dd&gt;
          &lt;/dl&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;/pre&gt;&lt;/code&gt;
  </code></pre>