};
foreach my $item (@{$rss->{'items'}}) {
next unless defined($item->{'title'}) && defined($item->{'link'});
print qq{$item->{'title'}
\n$item->{'description'}};
}
if ($rss->{'channel'}->{'copyright'}) {
print <<"HTML";
#!/usr/bin/perl # RSS CGI Prog use strict; use warnings; use CGI; use XML::RSS; use LWP::Simple; use Data::Dumper; my $cgi = CGI->new; my $url = "http://feeds.feedburner.com/animals"; my $content; my $rss = XML::RSS->new; if ($url=~ /http:/i) { $content = get($url); die "Could not retrieve $url" unless $content; $rss->parse($content); } print $cgi->header, $cgi->start_html(-style=>"/css/cgi_lesson1.css",-title=>"This is an RSS thingy."); print_html($rss); sub print_html { my $rss = shift; print <<"HTML";