Subject: | Bug report |
Error output after running script in attachment:
Use of uninitialized value in string eq at C:/Perl/site/lib/XML/RSS.pm
line 936.
Use of uninitialized value in string eq at C:/Perl/site/lib/XML/RSS.pm
line 936.
It's very strange, becouse that value is actually initialized. So please
fix this bug. Thank you.
Sincerely yours,
Evgen Dmitrnko.
Subject: | report.pl |
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
use XML::RSS;
use WWW::Mechanize;
use XML::Simple;
use LWP::UserAgent;
sub rss{
my $rss_url = 'http://feeds.feedburner.com/MoonViews/';
my $rss = new XML::RSS;
my $ua = new LWP::UserAgent;
$ua->timeout(10);
my $response = $ua->get($rss_url);
print $response->content;
$rss->parse($response->content);
my $cache={
title=>$rss->{channel}{title},
item=>[]
};
foreach my $item (@{$rss->{'items'}}[0..9]) {
next unless $item;
my $content=$item->{description};
$item->{pubDate}=~s/\+.*//;
push @{$cache->{item}},{
title=>$item->{title},
description=>$content,
time=>$item->{pubDate},
url=>$item->{link}};
}
print Dumper($cache);
}
&rss();