Reputation: 21
i´m trying to parse and read the content of a rss feed and getting an error.
this is my rss feed file (for test porpose)
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:Test="http://www.Test.com">
<channel>
<title>Deportes - Test.com</title>
<link>http://www.Test.com</link>
<description>Últimas noticias de deportes</description>
<item>
<title><![CDATA[El 'Chacho' Coudet es el nuevo entrenador de Rosario Central]]></title>
<link>http://442.Test.com/2014-12-15-326653-coudet-fue-presentado-como-nuevo-dt-de-central/</link>
<description><![CDATA[El Chacho, Tengo mucha alegría y ganas de empezar a trabajar. No esperaba que sea acá”, reconoció.]]></description>
<category><![CDATA[Deportes]]></category>
<pubDate>15 12 2014 06:15:0 +0000</pubDate>
<enclosure url="http://www.Test.com/__export/1418678333348/sites/diarioTest/img/2014/12/15/deportes/1215_coudet_g_fb.jpg" type="image/jpeg"><![CDATA[El Chacho Coudet]]></enclosure>
<author><![CDATA[]]></author>
<content><![CDATA[<p>Eduardo Coudet fue presentado como nuevo entrenador deRosario Central .</p>
]]></content>
</item>
</channel>
</rss>
this is my test.pl script file.
#!/usr/bin/perl
use strict;
use warnings;
use XML::Feed;
my $feed = XML::Feed->parse("test.xml");
for my $entry ($feed->entries) {
print $entry->content;
}
when i run this code i get this error.
Can't use string ("<p>Eduardo Coudet fue prese"...) as a HASH ref while "st
rict refs" in use at C:/Strawberry/perl/site/lib/XML/Feed/Entry/Format/RSS.pm li
ne 91.
i think is a bug inside XML::Feed
Reference: https://github.com/davorg/xml-feed/blob/master/lib/XML/Feed/Format/RSS.pm
Thanks
Upvotes: 1
Views: 321
Reputation: 21
SOLVED
The developer of this library fixed the bug on version 0.53
https://github.com/davorg/xml-feed/issues/16
Thanks, i hope this help other with the same issue
Upvotes: 1