You can eliminate the map by taking a slice:
my @var = @arr[ grep {$_ & 1} 1..$#arr ];
In reply to Re^2: Quicly extracting odd index elements in the array with grep
by bobf
in thread Quicly extracting odd index elements in the array with grep
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |