Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: One more parsing ATOM question

by frozenwithjoy (Curate)
on Jun 11, 2013 at 02:30 UTC ( #1038184=note: print w/ replies, xml ) Need Help??


in reply to One more parsing ATOM question

I've not used these modules, but from looking at them, my $feed = XML::FeedPP->new( $source ); creates a feed object and $parser->parse( $feed ); parses a string or IOhandle. Therefore, you are getting an error because you are giving the parser something unexpected.

Converting the feed object to a string solves your issue:

my $atom = $feed->to_string(); $parser->parse( $atom );

Output following this fix:

Magnitude 4.9 about Galapagos Triple Junction region Magnitude 5.0 about 75km ESE of Pangai, Tonga Magnitude 4.9 about 71km SW of Paita, Peru Magnitude 4.7 about 68km E of Sarangani, Philippines Magnitude 4.6 about 60km WNW of Lata, Solomon Islands Magnitude 4.8 about 170km ESE of City of Saint Paul, Alaska Magnitude 4.6 about South of the Fiji Islands Magnitude 4.6 about 98km NNW of Yunaska Island, Alaska

P.S. I get some Use of uninitialized value in concatenation (.) or string at ... warnings in your rules section.


Comment on Re: One more parsing ATOM question
Select or Download Code
Re^2: One more parsing ATOM question
by mcoblentz (Scribe) on Jun 11, 2013 at 11:23 UTC
    Oh! I didn't realize I was switching types. Thank you!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1038184]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (16)
As of 2014-07-29 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (217 votes), past polls