Stackoverflow的提要是Atom提要,我无法使用XML::RSS
本身解析它们,并尝试了其他目前已开发但仍不成功的解析器。我得到的最接近的分析结果是使用XML::Atom::Feed
模块,但无法绕过取消引用条目的链接对象。在XML中解引用:: Atom :: Feed
use strict;
use warnings;
use feature 'say';
use XML::Atom::Feed;
my $url = 'http://stackoverflow.com/feeds/tag?tagnames=r&sort=newest';
my $feed = XML::Atom::Feed->new(URI->new($url))
or die XML::Atom::Feed->errstr;
for ($feed->entries) {
say $_->title, "\n", $_->link;
}
哪些最新的30项输出如下:
Rcpp: Returning C array as NumericMatrix to R
XML::Atom::Link=HASH(0x24cbf00)
我意识到链接对象是一个散列引用,但我似乎失去了一些东西。
另外,有没有更好的解析XML Atom提要模块?
自从您首次提供了正确的'href()实现以来,我接受了您的答案。 '方法和来源。 – hwnd 2014-10-04 16:48:46