in reply to Re^2: Boolean array indexing
in thread Boolean array indexing

List::MoreUtils has a function indexes which does that:

indexes BLOCK LIST
Evaluates BLOCK for each element in LIST (assigned to $_) and returns a list of the indices of those elements for which BLOCK returned a true value. This is just like grep only that it returns indices instead of values:

@x = indexes { $_ % 2 == 0 } (1..10);   # returns 1, 3, 5, 7, 9

So you could write

@a[ indexes { $_ > 1 } @b ]

Not quite as nice as in Matlab but close.