# schwartzian [sp?] transform (perhaps not a paradigmatic example though) my @indicies = map {$_->[0]} grep {$a1[$_->[0]] eq $a2[$_->[1]]} map { my $l = $_; (map {[$l,$_]} 0 .. $#a2) } 0 .. $#a2;