in reply to Re^2: Quicly extracting odd index elements in the array with grep
in thread Quicly extracting odd index elements in the array with grep
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.
|
|---|