Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: One more parsing ATOM question

by frozenwithjoy (Priest)
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.

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1038184]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2018-01-21 11:24 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (227 votes). Check out past polls.