Here is my code
#!usr/bin/env perl
# Setup includes
use strict;
use XML::RSS;
use LWP::Simple;
# Declare variables for URL to be parsed
my $url2parse;
# Get the command-line argument
my $arg = shift;
# Create new instance of XML::RSS
my $rss = new XML::RSS;
# Get the URL, assign it to url2parse, and then parse the RSS content
$url2parse = get($arg);
die "Could not retrieve $arg" unless $url2parse;
$rss->parse($url2parse);
# Print the channel items
foreach my $item (@{$rss->{'items'}}) {
next unless defined($item->{'title'}) && defined($item->{'link'});
print "<li><a href=\"$item->{'link'}\">$item->{'title'}</a><BR>\n";
}
when I typed in %perl myRss.pl http://www.nytimes.com/services/xml/rss/userland/Education.xml, the console runs a while and returns "Could not retrieve http://www.engadget.com/rss.xml at myRss.pl line 14." Where does my code go wrong?