Created
April 15, 2014 17:26
-
-
Save tempire/10749982 to your computer and use it in GitHub Desktop.
every n of element, limited by selection of /3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The initial array | |
my @a = (1..100); | |
# Copy it, every 3rd elements | |
my @b = @a[ map { 3 * $_ } 0..$#a/3 ]; | |
# Print it. space-delimited | |
$, = " "; | |
say @b; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment