3dkiwi has asked for the wisdom of the Perl Monks concerning the following question:
Not wanting to name names but at the present time the following feed has a raw & symbol in the text that the parser is tripping over.!/usr/bin/perl -T $| = 1; use strict; use warnings; use XML::RSS; use LWP::Simple; use POSIX qw(strftime); my $there_is_a_feed_to_be_read = "true"; my $url_to_read = "http://xxx.xml"; my $url2parse; my $rss; while ( $there_is_a_feed_to_be_read ) { $rss = new XML::RSS; $url2parse = get( $url_to_read ); die "Could not retrieve $url_to_read" unless $url2parse; # all works up to this point but if there is an error in the # XML being read the next command chokes. # What I am looking for is some sort of wrapper to do a next # if there is a problem so we just step over the faulty feed $rss->parse($url2parse); # deal with the returned XML information here # . # . # . }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trapping Errors from XML::RSS
by kyle (Abbot) on Jun 19, 2007 at 03:27 UTC | |
by 3dkiwi (Novice) on Jun 19, 2007 at 04:03 UTC | |
by 3dkiwi (Novice) on Jun 19, 2007 at 03:44 UTC | |
|
Re: Trapping Errors from XML::RSS
by Zaxo (Archbishop) on Jun 19, 2007 at 03:27 UTC |