Perl 6 Perl 6 Lists and Arrays vivified #8

Arrays

Create an array of words

> my @words = < orange lime cherry banana lemon >;

Display the array

> say @words;
orange lime cherry banana lemon

Get the element at index 2

> say @words[2];     # note @ sigil
cherry

Slice of even-numbered elements

> say @words[0,2,4];
orange cherry lemon
Copyright © 2012
http://www.pmichaud.com/2012/pres/