I have encountered an RSS2 feed which fails in the module XML::Feed in regards to finding the datestamp of each entry, either modfied or issued. The feed itself seems to have "PubDate" in the entries, but I am not finding that with XML::Feed or else I am using XML::Feed incorrectly. I've reproduced a stripped down version of it below. How would I find the publication date for the single entry as shown in the demo below?

#!/usr/bin/perl use XML::Feed; use strict; use warnings; my $feed = XML::Feed->parse(\*DATA) or die XML::Feed->errstr; print $feed->title, "\n"; for my $entry ($feed->entries) { print "T=", $entry->title, "\n"; print "\tM=", $entry->modified||$entry->issued, "\n"; } exit(0); __DATA__ <rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"> <channel> <title><![CDATA[ foo bar one ]]></title> <link>https://example.org/rss2.xml</link> <description/> <language>en</language> <copyright>foo bar</copyright> <ttl>120</ttl> <item> <title><![CDATA[ Foo Bar Two ]]></title> <link>https://www.example.org/</link> <description><![CDATA[ <p align="center"> <span style="font-size: 0.75em;"> </span></p> <p>words words words</p> ]]></description> <pubDate>2019-09-10 13:38:00</pubDate> <guid isPermaLink="false">https://example.org/</guid> <dc:creator>foo bar three</dc:creator> </item> </channel> </rss>

In reply to RSS finding date of publication using XML::Feed by mldvx4

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.