diff options
Diffstat (limited to 'run/p5p')
-rwxr-xr-x | run/p5p | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -5,16 +5,16 @@ use warnings; use Net::NNTP; use HTML::Entities; -my %alt = ( - 'nntp.perl.org' => 'perl.perl5.porters', - 'news.gmane.io' => 'gmane.comp.lang.perl.perl5.porters', +my @alt = ( + ['nntp.perl.org' => 'perl.perl5.porters'], + ['news.gmane.io' => 'gmane.comp.lang.perl.perl5.porters'], ); my ($nntp, $count, $first, $last); -for my $server (keys %alt) { - $nntp = Net::NNTP->new($server, Timeout => 10) +for my $alt (@alt) { + $nntp = Net::NNTP->new($alt->[0], Timeout => 10) or next; - ($count, $first, $last) = $nntp->group($alt{$server}); + ($count, $first, $last) = $nntp->group($alt->[1]); last; } die "Cannot retrieve news: $!" if not $nntp; |