let myArray = ["alfa", "beta", "gamma"]; myArray.forEach( (elem, position) => console.log(`at position ${position} there is ${elem}`) ) #### at position 0 there is alfa at position 1 there is beta at position 2 there is gamma #### my @myArray = qw(alfa beta gamma) grep { warn "at position ??? there is $_\n" } @myArray; #### at position ??? there is alfa at position ??? there is beta at position ??? there is gamma