[...]
> The script works fine for a normal pod feed. It only fails when the feed
> only has one channel->item.
>
> Is line 65 OK?
>
> "foreach my $item (@{$data->{channel}->{item}}) {"
>
> all I want to do is step through one-by-one each item. Does that code
> work properly if there is only one item instead of many?

To find out, just make test cases:

use strict; use warnings;
my $data={channel=>{item=>[qw/one two/]}}; # >1 items 
foreach my $item (@{$data->{channel}->{item}}) {
        print "$item\n";
}
print "\n";
$data={channel=>{item=>[qw/one/]}}; # 1 item
foreach my $item (@{$data->{channel}->{item}}) {
        print "$item\n";
}

# output:
one
two

one

-- 
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