Re: newbie help for podcast script [with attach]
- From: security.department@xxxxxxxx (John Doe)
- Date: Sun, 31 Jul 2005 12:09:58 +0200
[...]
> 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
.
- References:
- newbie help for podcast script [with attach]
- From: alexeijh
- Re: newbie help for podcast script [with attach]
- From: John W. Krahn
- Re: newbie help for podcast script [with attach]
- From: alexeijh
- newbie help for podcast script [with attach]
- Prev by Date: HTML Emails
- Next by Date: Re: cross-eyed object problem
- Previous by thread: Re: newbie help for podcast script [with attach]
- Next by thread: Re: newbie help for podcast script [with attach]
- Index(es):
Relevant Pages
|