my @var = # Store the elements in @var. map { $arr[$_] } # Get the elements at the remaining indexes. grep { $_ & 1 } # Filter out the even indexes. 0..$#arr; # Create a list of @arr's indexes.
In reply to Re^3: Quicly extracting odd index elements in the array with grep
by ikegami
in thread Quicly extracting odd index elements in the array with grep
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |