Perl 6 Perl 6 Lists, Arrays, and Hashes vivified #7

Arrays

Create an array of words

> my @words = < postmodern modern romantic baroque classical >;

Display the array

> say @words;
postmodern modern romantic baroque classical

Get the element at index 2

> say @words[2];
romantic

Slice of even-numbered elements

> say @words[0,2,4];
postmodern romantic baroque
Copyright © 2011
http://www.pmichaud.com/2011/pres/