I previously asked how to do this in Groovy. However, now I\'m rewriting my app in Perl because of all the CPAN libraries.
If the page contained these links:
<
Sherm recommended HTML::LinkExtor, which is almost what you want. Unfortunately, it can't return the text inside the tag.
Andy recommended WWW::Mechanize. That's probably the best solution.
If you find that WWW::Mechanize isn't to your liking, try HTML::TreeBuilder. It will build a DOM-like tree out of the HTML, which you can then search for the links you want and extract any nearby content you want.