[EMAIL PROTECTED] wrote:
> *** SORRY, forgot to attach file. ***
> 
> Hi,

Hello,

> This is basically my 1st perl script.
> 
> It's a podcast download app. I don't now the etiquette for attaching
> files, but I have attached a <100 line perl file.
> 
> It seems that it fails if there is only 1 podcast for a feed with:
> 
> fetching http://www.abc.net.au/science/k2/podcast/drk_rss.xml ...
> 
> Odd number of elements in anonymous hash
> at /home/lexhider/bin/GodCast.pl line 65.

It looks like you are using XML::Simple::XMLin() incorrectly:

 51         my $data = $xml->XMLin(get $feed or die "failed to fetch
$feed\n");


$ perl -MO=Deparse,-p -e'my $data = $xml->XMLin(get $feed or die "failed
to fetch $feed\n");'
(my $data = $xml->XMLin(($feed->get || die("failed to fetch $feed\n"))));
-e syntax OK

You are trying to call the get() method on the $feed object.  Read the
documentation for the correct syntax for XML::Simple::XMLin().

perldoc XML::Simple


As to the warning message:

perldoc perldiag
[snip]
       Odd number of elements in anonymous hash
           (W misc) You specified an odd number of elements to
           initialize a hash, which is odd, because hashes come in
           key/value pairs.

So your $data variable is not being assigned a valid anonymous hash
probably because you are using XML::Simple::XMLin() incorrectly.


> fileparse(): need a valid pathname at /home/lexhider/bin/GodCast.pl line
> 68

You are using File::Basename::basename() to parse a URL.  You should use
a module that understands URLs to do that.


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to