I need code in Perl for requesting and parsing ATOM and RSS feeds. Is there a CPAN module(s) for that?
4 Answers
Almost any time that you ask "How can I do X in Perl?", the answer is to look at CPAN Search to find the module that does it.
To download from the web, the LWP family of modules can help you. To parse the documents, try something with Feed, RSS, or Atom in the name.
Four years later, though, I now recommend Mojolicious, which has its own user agent module and very strong support for DOM parsing and the various ways to pull out parts of a document. Depending on what you want, you probably don't need a special feed module anymore.

- 129,424
- 31
- 207
- 592
-
2Brian, this isn't as helpful as you might hope in this case: searching for 'RSS' and a few other terms tends to get you writers, plugins for other tools and old, dead modules and any signal in there is drowned out by noise. – ijw Jun 15 '09 at 12:02
-
2@ijw: spend more than 3 minutes trying. – brian d foy Jun 15 '09 at 16:26
-
I would like to see a "popularity" or "downloads" sort in the CPAN Search (and PPM) like Nuget has http://nuget.org/packages It's not a bad proxy for "how good is this module?". – Matthew Lock Feb 10 '13 at 13:16
-
1Try [MetaCPAN](https://www.metacpan.org) for ++ on modules. That doesn't mean anything about quality though. :) – brian d foy Feb 10 '13 at 23:31
XML::FeedPP is good ...

- 2,727
- 2
- 20
- 22
-
Beware of at least http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=libxml-feedpp-perl;dist=unstable but it's the best thats out there, AFAIK. – derobert Dec 28 '08 at 13:54
Both XML::RSS and XML::Atom exist. Be warned -- XML::Atom does not seem to be actively maintained and reportedly has bugs. But the basics should be enough to get you going.
To fetch the feeds LWP::Simple is a good choice.

- 129,424
- 31
- 207
- 592
-
1XML::RSS is primarily used to generate RSS files but it also has `parse()` methods to read RSS. – krock Jul 24 '10 at 05:23