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 |