I'm trying to fetch and parse an Atom feed using XML::Atom::Feed and the code below:

#!/usr/bin/perl -w use strict; use XML::Atom::Feed; my $feed = XML::Atom::Feed->new('http://mildlydiverting.blogspot.com/a +tom.xml'); for my $entry ($feed->entries()) { print $entry->title()."\n"; }

This works fine on my local machine, but on my server I get:

Cannot open file 'http://mildlydiverting.blogspot.com/atom.xml' at /home/philg/scripts/extlib/XML/XPath.pm line 53.

It seems that my local machine has LibXML, but the server doesn't. So on the server XML::Atom::Feed is falling back to use XPath instead. But for some reason XPath is being told to fetch the Atom feed from the remote URL, which it isn't designed to do.

My Perl skills aren't sufficient for me to work out where things are going wrong in XML::Atom::Feed, if that's the culprit... any ideas how I can get this working without LibXML? Many thanks.

(FWIW, I was originally trying to debug this problem while using XML::Feed, and tracked the problem back to this point.)


In reply to XML::Atom::Feed with XML::XPath not fetching feed by philgyford

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.