I have and iPod, and I'm trying to write a program that will read RSS feeds, format them, and save them onto my iPod. I have no problem saving them to the iPod, but here's what I need help with:
I've tried using XML::RSS::Parser in a program like this:
#!/usr/bin/perl -w
use strict;
use XML::RSS::Parser;
use URI;
use LWP::UserAgent;
use Data::Dumper;
my $ua = LWP::UserAgent->new;
$ua->agent('XML::RSS::Parser Test Script');
my @places=( 'http://www.mplode.com/tima/xml/index.xml' );
my $p = new XML::RSS::Parser;
foreach my $place ( @places ) {
# retreive feed
my $url=URI->new($place);
my $req=HTTP::Request->new;
$req->method('GET');
$req->uri($url);
my $feed = $ua->request($req);
# parse feed
$p->parse( $feed->content );
# print feed title and items data dump to screen
print $p->channel->{ $p->ns_qualify('title', $p->rss_namespace
+_uri ) }."\n";
my $d = Data::Dumper->new([ $p->items ]);
print $d->Dump."\n\n";
}
The above is the program listed in the documentation of XML::RSS::Parser. The program works fine, but I do not know how to use $p->items. In the documentation of XML::RSS::Parser, it says $p->items returns a reference to an array of hash references. How do you work with a refrence to an array of hash refrences? Refrences have always confused me, and I don't think the Camel explains it in simple enough terms.
Thanks in advance,
-munchie