in reply to grep { } positional number of element

In plain old ordinary basic perl (whatever that is) I'd just do:

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11147614 use warnings; my @myArray = qw(alfa beta gamma); warn "at position $_ there is $myArray[$_]\n" for 0 .. $#myArray;