From f95bae8026a539fcd4c2e7fde188a959a6b78169 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 16 Apr 2003 13:44:14 +0000 Subject: MDK::Common::Func: map_index, each_index and grep_index do not pass $::i as a parameter anymore (this breaks backward compatibility, but it is cleaner and otherwise perl_checker doesn't handle it correctly) --- MDK/Common/Func.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'MDK/Common') diff --git a/MDK/Common/Func.pm b/MDK/Common/Func.pm index caa5358..7ce9d5a 100644 --- a/MDK/Common/Func.pm +++ b/MDK/Common/Func.pm @@ -236,20 +236,20 @@ sub every(&@) { sub map_index(&@) { my $f = shift; my @v; local $::i = 0; - map { @v = &$f($::i); $::i++; @v } @_; + map { @v = $f->(); $::i++; @v } @_; } sub each_index(&@) { my $f = shift; local $::i = 0; foreach (@_) { - &$f($::i); + &$f->(); $::i++; } } sub grep_index(&@) { my $f = shift; my $v; local $::i = 0; - grep { $v = &$f($::i); $::i++; $v } @_; + grep { $v = $f->(); $::i++; $v } @_; } sub find_index(&@) { my $f = shift; -- cgit v1.2.1