title: How to extract data from an RSS feed using Perl with XML::Feed
body: <p>I am trying to grab a piece of information about the length of a MP3 file from an RSS feed.</p>
  
  <p>Here is the Perl script I am hacking away at:</p>
  
  <pre><code>#!/usr/bin/perl
  use XML::Feed;
  use Data::Dumper;
  
  my $rssurl      = "http://librivox.org/rss/4273";
  my $feed = XML::Feed-&gt;parse(URI-&gt;new($rssurl))
      or die XML::Feed-&gt;errstr;
  print $feed-&gt;title, "\n";
  print $feed-&gt;description, "\n";
  for my $entry ($feed-&gt;entries) {
  #       print "entery is [$entry]\n";
  #       print Dumper( $entry );
          print $entry-&gt;title, "\n";
          print $entry-&gt;{'http://www.itunes.com/dtds/podcast-1.0.dtd'}{'duration'} . "\n";
          print $entry-&gt;duration . "\n";
  }
  </code></pre>
  
  <p>When I run the script I get this output:</p>
  
  <pre><code>Conquest Over Time by SHAARA, Michael
  &lt;p&gt;Pat Travis, a spacer renowned for his luck, is suddenly quite out of it. His job is to beat his competitors to sign newly-Contacted human races to commercial contracts...
  
  But what can he do when he finds he's on a planet that consults astrology for literally every major decision - and he has arrived on one of the worst-aspected days in history?
  
  Michael Shaara, later to write the Pulitzer-winning novel "The Killer Angels", wrote this story for Fantastic Universe in 1956. (Summary by Mark F. Smith)&lt;/p&gt;
  1 - Section 1
  
  Can't locate object method "duration" via package "XML::Feed::Entry::Format::RSS" at ./get_feed.pl line 15.
  </code></pre>
  
  <p>If I add <code>print Dumper( $entry );</code> for debugging I can see this bit of data:</p>
  
  <pre><code>$VAR1 = bless({
    _version =&gt; "2.0",
    entry =&gt; {
      "enclosure" =&gt; {
        length =&gt; "9.6MB",
        type =&gt; "audio/mpeg",
        url =&gt; "http://www.archive.org/download/conquest_over_time_1005_librivox/conquestovertime_1_shaara_64kb.mp3",
      },
      "http://www.itunes.com/dtds/podcast-1.0.dtd" =&gt; { block =&gt; "No", duration =&gt; "00:20:00", explicit =&gt; "No" },
      "item" =&gt; ("\n    " x 12),
      "link" =&gt; "http://www.archive.org/download/conquest_over_time_1005_librivox/conquestovertime_1_shaara_64kb.mp3",
      "title" =&gt; "1 - Section 1",
    },
  }, "XML::Feed::Entry::Format::RSS")
  </code></pre>
  
  <p>The piece of data I want is the duration <code>00:20:00</code>. How do I get that in my script?</p>
  
  <p>Thanks!</p>