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 cherrycontinued...
Perl 6 | Perl 6 Lists and Arrays vivified | #8 |
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 cherrycontinued...
Copyright © 2012 http://www.pmichaud.com/2012/pres/ |