Avoid making ponysaylinklist.pl depend on List::MoreUtils.

This commit is contained in:
spider-mario 2012-07-28 14:25:53 +02:00
parent a42fe1fd4e
commit 7faba4584f

View file

@ -12,19 +12,19 @@
use strict; use strict;
use warnings; use warnings;
use utf8; use utf8;
use List::MoreUtils qw(natatime);
my %hash; my %hash;
my $it = natatime 2, @ARGV; {
while (my ($source, $target) = &$it) { local @ARGV = @ARGV;
while ((my ($source, $target), @ARGV) = @ARGV) {
unless ($source eq $target) { unless ($source eq $target) {
push @{$hash{$target}}, $source; push @{$hash{$target}}, $source;
} }
} }
}
$it = natatime 2, @ARGV; while ((my ($source, $target), @ARGV) = @ARGV) {
while (my ($source, $target) = &$it) {
if ($source eq $target) { if ($source eq $target) {
my @list = @{$hash{$source} // []}; my @list = @{$hash{$source} // []};
print $source; print $source;