diff options
author | John Ankarström <john@ankarstrom.se> | 2021-05-09 01:20:49 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-05-09 01:20:49 +0200 |
commit | 3013d5e295035c8a1e98fe97d98e59b10d208c04 (patch) | |
tree | 5f99b0f305b4929ca09ff95c59454c575e4ff37e | |
parent | 115cb64a6a4d43d610b034a8ded9f3db23cdcd83 (diff) | |
download | perlisdead-3013d5e295035c8a1e98fe97d98e59b10d208c04.tar.gz |
Forgot hashes aren't ordered
-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; |