Digamos que tengo esta lista:¿Cómo puedo obtener el índice de un elemento cuando grep a través de una matriz?
my @list = qw(one two three four five);
y quiero agarrar todos los elementos que contienen o
. Tendría esto:
my @containing_o = grep { /o/ } @list;
Pero ¿qué tendría que hacer para recibir también un índice, o para poder acceder al índice en el cuerpo grep
's?
Nice thinking :)! – Geo