Howdy bros. I'm having a problem trying to parse an RSS feed using XML::FeedPP. The feed is al Aribiya English, which looks like a normal feed when opened in a browser. I am getting it with XML::FeedPP like so:
$feedurl = 'http://www.alarabiya.net/rss/en_meast.xml'; eval { $feed = XML::FeedPP->new( $feedurl ) }; if ($@) { print LOG "\tFeed Error: $@\n"; }
When this executes STDERR gives a message that says:
Invalid string: [\xEF\xBF\xBD\x788\x4D\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF +\xBD\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD\x3F\xEF\xBF\xBD\ +xEF\xBF\xBD\x5D\xEF\xBF\xBD\xEF\xBF\xBD\x03\x55\x73\xEF\xBF\xBD\xEF\x +BF\xBD\xCC\x8D\x15\x73\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xB +D\xEF\xBF\xBD\x10\x1A\xEF\xBF\xBD\x00'\x5B\xEF\xBF\xBD\x0C\x76\x1D\x7 +4\xEF\xBF\xBD\xEF\xBF\xBD\x64\x78\x71\xEF\xBF\xBD\x13\x60\xDC\xBB\xEF +\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD(\x60\xEF\xBF\xBD\x5C\x65\xEF\xBF\xBD +\xEF\xBF\xBD=\x67\xEF\xBF\xBD\x0F\x16\xEF\xBF\xBD\x13\xEF\xBF\xBD&\x6 +7\xEF\xBF\xBD\xEF\xBF\xBD\x52\x69\x15!\x170\x16\x1E\x58\xEF\xBF\xBD\x +60\xEF\xBF\xBD\x6B%\xEF\xBF\xBD(\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD\ +xEF\xBF\xBD\x0F\x55\xEF\xBF\xBD\x04\x6C\x19\x15\x73\xEF\xBF\xBD\x57\x +4A\xEF\xBF\xBD\x6C\x75\xEF\xBF\xBD2\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\x +BD\x0B'\x74\xCD\x8E\x5E\xEF\xBF\xBD\x57\xEF\xBF\xBD\xEF\xBF\xBD\x48\x +EF\xBF\xBD\x72\x4C\x6B\x55\x63,\x01\x04\x10\xEF\xBF\xBD\xEF\xBF\xBD\x +0L�3\xEF\xBF\xBD\x7B\x77\x05\xEF\xBF\xBD\xDD\xBB\xEF\xBF\xBD\x11\x7 +3\xEF\xBF\xBD\x79\xEF\xBF\xBD\x46] before <S �=�68�]¿½e�^��*���¿½7ï2B�Ì��簡$3�35*y> at / +home2/alkisahi/perl/usr/lib/perl5/site_perl/5.8.8/XML/FeedPP.pm line +521
Actually, it gives about five such invalid string errors.

The LOG written in the if statement above says:

Feed Error: Invalid feed format: %&#65533;:&#65533;q&#65533;&#65533;&# +65533;J&#65533;&#65533;DB"b&#65533;`
Then the whole script crashes.

This is puzzling in many ways. First, I don't get why the whole script crashes, given that the call is being made inside an eval block. Second, I don't know where these invalid strings are coming from because like I said the feed looks pretty normal to me. Third, XML::FeedPP is crashing on line 521, which is the first line of the following:

if ( $method eq 'url' ) { $tree = $tpp->parsehttp( GET => $source ); }
which doesn't even seem to be evaluating a string from the feed. :-/

Does anyone have any idea what is going on here or how I can debug?

TIA...Steve


In reply to XML::FeedPP Crashing Despite Eval by cormanaz

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.