aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspider-mario <spidermario@free.fr>2012-07-28 14:25:53 +0200
committerspider-mario <spidermario@free.fr>2012-07-28 14:25:53 +0200
commit7faba4584f360df4c2c12f52bb1784c08c0dca57 (patch)
tree6ef0dfbd21a0c22a528720896028adb68e2a2135
parenta42fe1fd4eb7fdb841d1668f8242051f3c9f5343 (diff)
downloadponysay-7faba4584f360df4c2c12f52bb1784c08c0dca57.tar.gz
ponysay-7faba4584f360df4c2c12f52bb1784c08c0dca57.tar.bz2
ponysay-7faba4584f360df4c2c12f52bb1784c08c0dca57.zip
Avoid making ponysaylinklist.pl depend on List::MoreUtils.
-rwxr-xr-xponysaylinklist.pl14
1 files changed, 7 insertions, 7 deletions
diff --git a/ponysaylinklist.pl b/ponysaylinklist.pl
index 4d34928..bb3a631 100755
--- a/ponysaylinklist.pl
+++ b/ponysaylinklist.pl
@@ -12,19 +12,19 @@
use strict;
use warnings;
use utf8;
-use List::MoreUtils qw(natatime);
my %hash;
-my $it = natatime 2, @ARGV;
-while (my ($source, $target) = &$it) {
- unless ($source eq $target) {
- push @{$hash{$target}}, $source;
+{
+ local @ARGV = @ARGV;
+ while ((my ($source, $target), @ARGV) = @ARGV) {
+ unless ($source eq $target) {
+ push @{$hash{$target}}, $source;
+ }
}
}
-$it = natatime 2, @ARGV;
-while (my ($source, $target) = &$it) {
+while ((my ($source, $target), @ARGV) = @ARGV) {
if ($source eq $target) {
my @list = @{$hash{$source} // []};
print $source;