Another useful module for parsing HTML is HTML::TreeBuilder. I like this module because it parses the whole document at once, and then returns a nicely structured tree that you can walk. It's a different approach from the other common HTML parsing modules.