Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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]
marioroy MCE 1.830 is completed. I will release it after completing MCE::Shared.
marioroy concurrent Tie::File among many workers is possible via MCE::Shared.
marioroy Ditto for DB_File, BerkeleyDB, etc. ;-)

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2017-08-18 07:45 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (296 votes). Check out past polls.