Latest News
If you are using the Perl module XML::RSS in the following way:
my $R = XML::RSS->new;
foreach my $url (@urls) {
my $content = wget($url);
$R->parse($content);
}
In older versions of the XML::RSS module, this code worked fine. However, if you have upgraded the module recently, you might have noticed the error message:
Modification of non-creatable array value attempted, subscript -1 at /usr/local/lib/perl5/site_perl/5.8.5/XML
/RSS.pm line 792.
It is not the feed that has gone rancid on you, but the library. Try instantiating a RSS object within the loop like this:
foreach my $url (@urls) {
my $content = wget($url);
my $R = XML::RSS->new;
eval{$R->parse($content)};
if ($@) {
warn("Parse error: $@");
next;
}
}
I've added some "exception" handling for free in this example so that parse errors don't blow up your program.
I'm afraid I did not dive into XML::RSS.pm to figure out the problem, but if someone with that knowledge wishes to post below, I'm sure won't be the only one who welcomes enlightenment.
About this blog
The taskboy blog is a exploration of computer technology by Joe Johnston. Topics of posts include practical examples Perl, PHP, Python and Java as well as book reviews, industry insights and miscellaneous good stuff.
Current Status
Watching _Brass Latern_. Ah IF, your coyness is your charm.
Posted: Sun Sep 05 16:02:15 +0000 2010
Latest Feedbag
- Grain Sack Doubles Up As A Water Purifier Kit
- BMW Takes Internet Car Reveals To A Weird New Level
- Monocolumn: Imelda Marcos, Mark 2
- Zoodles Brings Kid-Friendly Browser To Android Phones
- Context Optional Helps Brands Run Location-Based Promotions On Facebook Places
- Eric Schmidt: Were Already Fast..Fast Is About To Get Faster
- Coulomb Wins $15 Million To Roll Out Electric Vehicle Charging Stations Across America
- Ping Is Apples iTunes For Everything
- A 'new normal' for oil and natural gas prices?
- Kim Clijsters to face Venus Williams in US Open semis
Generated: 09:45 on 08/Sep/2010
Recent posts
- Very quick git primer for basic functionality
- Tips for spammers: don't insult me
- CakePHP vs. Symfony: a quick note
- Creating events for Yahoo and Google calendars
- SANs on a budget: iSCSI under Ubuntu
- iPad, iTouch and Kindle: Which is the better mousetrap?
- Rise of the Ad-Hocracy, Part II
- Rise of the Ad-Hocracy, Part I
- Small Hiatus
