summaryrefslogtreecommitdiffstats
path: root/MDK/Common/Func.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-04-16 13:44:14 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-04-16 13:44:14 +0000
commitf95bae8026a539fcd4c2e7fde188a959a6b78169 (patch)
treeed0aa6cc2cb318addb2d55e30f79a7cda7464099 /MDK/Common/Func.pm
parent3f4b378563c6988b94d9c27169b541fae5873448 (diff)
downloadperl-MDK-Common-f95bae8026a539fcd4c2e7fde188a959a6b78169.tar
perl-MDK-Common-f95bae8026a539fcd4c2e7fde188a959a6b78169.tar.gz
perl-MDK-Common-f95bae8026a539fcd4c2e7fde188a959a6b78169.tar.bz2
perl-MDK-Common-f95bae8026a539fcd4c2e7fde188a959a6b78169.tar.xz
perl-MDK-Common-f95bae8026a539fcd4c2e7fde188a959a6b78169.zip
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)
Diffstat (limited to 'MDK/Common/Func.pm')
-rw-r--r--MDK/Common/Func.pm6
1 files changed, 3 insertions, 3 deletions
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;